The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Jun 06, 2010 4:37 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Feb 08, 2008 9:19 pm
Posts: 23
Location: U.S.A.
I am using a portfolio component that I would like to be able to set different parameters on for separate areas of my site. The component will only allow one setting throughout the site and I can't seem to get around it. I figured I might try installing a second instance of the component to allow me to have different settings for each. This way I could treat them as two different components.

Does anyone know what I would need to change in the original zip file so I can install it into Joomla as a separate component? Is it simply changing file and folder names or would I have to dig even deeper into individual files?

Thanks,
Matt


Top
 Profile  
 
PostPosted: Sun Jun 06, 2010 6:51 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Jan 31, 2010 12:25 pm
Posts: 46
The jos_components table of the db determines what you can configure in the back-end so if you manually added a new record, you could make a new component appear that referenced a single front-end component but any changes made to one of them would affect the front end in the same way! You might need to create duplicate tables for each of the tables installed by the original component. Then you would need to make sure that all of the SQL queries executed by the component made changes to the new duplicate table and that the Jtable function i n the backend referenced this table. This should be possible to do using find/replace without too much trouble. Finally, of course you'd need to create an extra menu item for the new duplicate component.

There might be an easier way than this, but that's how I'd try it.


Top
 Profile  
 
PostPosted: Sun Jun 06, 2010 10:23 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Feb 08, 2008 9:19 pm
Posts: 23
Location: U.S.A.
Thanks for the advice mrPilsener. I was hoping to avoid having to create new tables in the database because I am not versed in editing the SQL. I took a look at the db using phpMyAdmin and I can see the component in the jos_components table. I'm just a little overwhelmed never having dealt with this before. Can I export the data from the component and then import it with a different name or would I have to manually type in a new record?

I figured maybe trying to edit the install files would allow Joomla to do the work of setting up the tables for me as a new component. I just don't know where to begin with that. Maybe it is easier for me to look at some tutorials on how to use phpMyAdmin and give that a whirl? If you know of anywhere you can point me to explain a little better that would be appreciated.


Top
 Profile  
 
PostPosted: Wed Jun 23, 2010 5:42 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Feb 08, 2008 9:19 pm
Posts: 23
Location: U.S.A.
Figured it out 8)

I simply replaced the component name along with associated filenames in the original zip file. I'll try to explain.....

I downloaded the original component, in this case I am using a portfolio component, then extracted the zip file. Found out the name used in Joomla for the component which happens to be "com_portfolio".

So, I used a tool called find & replace which will look through a specified directory for any specific text that you ask it to (do a Google search, there are tons of these free tools). Had it look through all the files in the downloaded zip file (after it was extracted) and find the word "portfolio" and replaced it with "portfolio2". This changed every instance of the word portfolio in every file.

Then I did a search for all folders and filenames which include "portfolio" in the same directory ( in Windows you can do this with the search tool in the Start Menu). Modified each file that had the word "portfolio" to "portfolio2". This means all the files that include the word portfolio - "admin.portfolio.html" would now be "admin.portfolio2.html" for example and folders like "com_portfolio" would now be "com_portfolio2".

After changing the folders and filenames I created a new zip file with the main folder, this is the top level of the extracted zip file which should have the same name as the original zip file that was downloaded. Installed this file as a new component in Joomla and so far has worked flawlessly as a completely new component.

By doing it this way, Joomla sees the new zip file as a completely different component than the original and it takes care of writing the data in the DB for you but doesn't mess up the original DB. Obviously you should try this on a dummy site before trying on a live site because there may be something different in the specific component that you are using that may need some tweaking. Oh yeah, make sure to back up your site before trying any of this. My first couple of tries had undesireable results until I figured out what I was doing.

Best of luck,
Matt

_________________
http://www.5minutemogul.ws


Top
 Profile  
 
PostPosted: Wed Jun 23, 2010 10:39 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Jan 31, 2010 12:25 pm
Posts: 46
Well done. Sorry I couldn't be any more use and glad you got there on your own!


Top
 Profile  
 
PostPosted: Wed Jun 23, 2010 10:54 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Feb 08, 2008 9:19 pm
Posts: 23
Location: U.S.A.
On the contrary mrPilsener, your suggestions made me think about the DB a little more which led me to editing the files the way I did. It was a good learning exercise, I feel like I'm understanding more and more about how Joomla works behind the scenes. Thanks again for your help.

_________________
http://www.5minutemogul.ws


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



Who is online

Users browsing this forum: No registered users and 21 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