By tanyi on
I would like to duplicate a module so I can use the same module on my site but create 8 different versions. Which file in the module's folder do I change the name so that I can have 8 different seperate installations on my site?
Comments
=-=
Seems to me that it depends on which module you are wanting to do this to.
Functions may need to be altered to avoid collisions in the .module file
the .info file would need to be altered
the DB tables (if any) would need to be altered. so on so forth.
Without knowing which module you want to treat this way, it's difficult to be specific when helping or determine if what you are looking to do is even necessary.
The ed_classified module
I am working on a classifieds site with 8 diff categories: For Sale, Pets, housing etc. I have added fields to the ed_classified module but these fields are not applicable to all the categories so it is confusing. For example one does not need to see the Price field when submitting an ad in the Personals category. So I would like to create 8 different Submit Classified ad pages each with different fields. That is why I need 8 different versions of the module. Let me know if there is another way to accomplish this. Thanks.
Duplicate content types instead of entire module
I'm currently working with this module myself, so I'm still getting familiar with it. I'm not absolutely sure, but I think you can make copies of your Classifed Ad content type. Try this:
Install the CCK module if you haven't already http://drupal.org/project/cck
Enable the CCK module and also check the box labeled Content Copy
Go to Administer>Content Types
Choose the Export Tab
Select the radio button for Classified Ad then hit the export button
A bunch of code will be generated. Copy all of it
Click on the tab for Add Content Type
Create save new content type
Click on Import Tab
Select the radio button for you your new content type and hit the import button
Paste the Code that was generated from the export you did earlier and now save your new content type.
You should now have a copy of your Classified Ad content type. When I did this I noticed that it copied all the fields except Ad Title and Ad Text which means you might have to go back to your original idea of editing or duplicating the module. I haven't gone that far yet. I'm actually trying to figure out a way to allow someone to reply to the Ad using Privatemsg so users don't have to list their phone or email. Of course I don't want hijack your post with my question so I will create my own post now. But if you happen to already have a similar feature setup on your's I'd be interested in how you did it.
Another idea... Could you use Views instead?
I just had another idea regarding your need to have different forms based on content in the Classified Ad module. I just installed the Job Listings Module to compare the features between it and the Classified module. Seeing how they are similar in display it occurred to me that your issue could probably be solved most easily by using CCK and Views with the Classified Ad module. Use CCK to add all the possible fields to the Classified Ad content type then use Views to show only the related fields for each of your categories. The end result will be Views for each category and the url will look something like www.yoursite.com/Sale/ www.yoursite.com/Pets/ etc.
u need 8 content types. not
u need 8 content types. not 8 module.
Cintent types
If I create a new content type from the ed_classified module, then the new content type does not have the expiration settings so the admin can't specify an expiration time. Also the new content type does not have the 'My Classifieds Ads' list in the user's profile. These are only a few of the functionality missing when you create a new content type from this module.
Maybe you need 8 Views not 8 Content Types or Modules
I think you can still get by with the original Classified_Ed content type without trying to create duplicate content types.
Try this:
Stick with the Classified Ed content type that comes with the module.
Use CCK to create all possible fields regardless of the kind of listing it will be. This means your pet listing will show fields that would also be in your housing listing, like maybe number of rooms or square footage, but using Views will fix this because you can choose which fields will show for each individual view.
So it would be the same idea as the last two sentences in my previous post...