I am using the News module for news items, but would also like to use the same functionality to manage and display author bios. I don't want to use the News module with a separate category because there are custom fields I'd like to add for the bios which are not applicable to the news items.
So here is the question - is there a simple way to create a "duplicate" of the News module, called say "Writers" - created such that it has all the functionality and features of the News module, but uses a different name, different database fields etc. so it can be completely independent of the original module.
I realize I can do a global search and replace of the module code (and rename the module directory), but is there a simpler (or previously implemented) way to go about this?
TIA,
Sanjay
[SOLVED] Is there a way to duplicate a module?
[SOLVED] Is there a way to duplicate a module?
Last edited by spcherub on Sun Oct 18, 2009 1:06 pm, edited 1 time in total.
Re: Is there a way to duplicate a module?
This is the best/only way to do what you are wanting to do. It has been done before on News and other modules. Just make sure you get EVERYTHING changed.spcherub wrote: I realize I can do a global search and replace of the module code (and rename the module directory), but is there a simpler (or previously implemented) way to go about this?
Re: Is there a way to duplicate a module?
Why not use CGBlog module? I think it is cut down version of News module. You will be able to edit entries from back end, assign multiple categories, create custom fields, use templates.
[SOLVED] Re: Is there a way to duplicate a module?
Thanks! That is a great idea. I knew there were other "news-inspired" modules out there, but could not find one that fit. So this will suffice for this particular project, but I'm still on the look out for an easy way to "fork" a module. I suppose someone with the scripting chops could come up with a way to "global search/replace" and duplicate modules.Peciura wrote: Why not use CGBlog module? I think it is cut down version of News module. You will be able to edit entries from back end, assign multiple categories, create custom fields, use templates.
Thanks for the responses.
Re: [SOLVED] Is there a way to duplicate a module?
I have made a script for this once. I have put an example in the Dutch forum that copies the Guestbook modules.
http://forum.cmsmadesimple.org/index.ph ... #msg166748
Give $module the value of the directoryname of the module you would like to copy.
Then you only need to edit the $trans array. In case of news module you would at least need values News, news, Article, article to be replaced. Also don't forget to put the names of constants there as well. If you get an error after you installed the module copy, you did not changed enough values,
Note that you won't be able to do any updates on the module copy!
http://forum.cmsmadesimple.org/index.ph ... #msg166748
Give $module the value of the directoryname of the module you would like to copy.
Then you only need to edit the $trans array. In case of news module you would at least need values News, news, Article, article to be replaced. Also don't forget to put the names of constants there as well. If you get an error after you installed the module copy, you did not changed enough values,
Note that you won't be able to do any updates on the module copy!
Last edited by Jos on Sun Oct 18, 2009 1:41 pm, edited 1 time in total.
Re: [SOLVED] Is there a way to duplicate a module?
Thanks Jos - that was exactly what I was looking for. I will give it a shot.
S
S