The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Extend a Component
PostPosted: Sat Jun 16, 2012 11:34 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jan 07, 2012 2:35 pm
Posts: 21
Hi

Is it possible to extend a component with additional views?
I created a gallery component and would like to extend that component with the function "user upload". This means I need at least an additional view on the frontend. I don't want to include that feature in my gallery. I want this to be implemented as an extension for my component.

Is there some kind of concept/pattern for this?

I know you can create modules and plugins for a component and you can also make "alternative layouts" inside your template for a component. But that's all not what I'm searching for...

What I'm basically searching for is a way to provide an install package that can be installed via the Joomla Extension Manager that adds a view to my component.


Thank you for your help
-- Domenic


Top
 Profile  
 
 Post subject: Re: Extend a Component
PostPosted: Mon Jun 18, 2012 2:12 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri May 04, 2012 3:26 pm
Posts: 45
You should be able to use the html folder inside the template you are using to define additional views.


Top
 Profile  
 
 Post subject: Re: Extend a Component
PostPosted: Tue Jun 19, 2012 6:02 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jan 07, 2012 2:35 pm
Posts: 21
Hi bpc_hw
Thanks for your response.

But did you read my entire post? As I wrote, I know you can place additional layouts (and views) in your template folder. But that's not a solution for someone who wants to distribute his extensions. Why should I want to find a way to extend a component if it was just for me? In that case I simple could place that additional view in my component. (I mentioned that I wrote the component by myself...)


Top
 Profile  
 
 Post subject: Re: Extend a Component
PostPosted: Tue Jun 19, 2012 1:49 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri May 04, 2012 3:26 pm
Posts: 45
Do you mean defining an additional view within the component?


Top
 Profile  
 
 Post subject: Re: Extend a Component
PostPosted: Tue Jun 19, 2012 2:12 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jan 07, 2012 2:35 pm
Posts: 21
bpc_mw wrote:
Do you mean defining an additional view within the component?


That's pretty much what I mean.
The view should be placed in the component. That should be done with an additional extension that can be installed (and uninstalled) with the built in joomla extension manager (or how this thing is called).


Top
 Profile  
 
 Post subject: Re: Extend a Component
PostPosted: Tue Jun 19, 2012 4:41 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri May 04, 2012 3:26 pm
Posts: 45
I am pretty sure it is as easy as just creating another folder in the view folder. I am still learning myself though, so I am not sure if something has to be defined a certain way to do that.

Then you call it using JRoute if you are linking to it.
JRoute::_('index.php?option=com_yourcomponent&view=viewname');


Top
 Profile  
 
 Post subject: Re: Extend a Component
PostPosted: Wed Jun 20, 2012 11:32 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jan 07, 2012 2:35 pm
Posts: 21
I'm sorry but you got me all wrong...

I don't blame you. I blame me for not being able to express myself in a way that everybody can understand.

Anyway... I found a solution:
In Joomla 2.5 (maybe even earlier) you can define the extension type file in the manifest (the xml- file in every extension) of your extension. This gives you the possibility to place files anywhere you want in the joomla folder. Together with the script file (which can be defined with the scriptfile- tag) you can pretty much extend your "core"-extension (in my case my gallery component) in every way you can imagine.
Maybe there's a better way to do it but I would say mine is not the worst (and it works just great [installing, updating and uninstalling])...


Top
 Profile  
 
 Post subject: Re: Extend a Component
PostPosted: Thu Jun 28, 2012 4:51 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri May 04, 2012 3:26 pm
Posts: 45
Actually that sounds like the solution to something I am trying to do. Can you post an example (with variable changed to protect the innocent of course)?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 



Who is online

Users browsing this forum: jodofin and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group