Page 1 of 1

How to install a copy of the News module?

Posted: Tue Jan 15, 2013 3:07 pm
by ehaldur
Hi all!

I need to create my own Content-type module with custom functions. {News} fits perfectly as a basic working module, which I decided to edit...

How I can install {News} module twice. Is it possible? How I can rename it? ???


Thanks for any help...

Re: How to install a copy of the News module?

Posted: Fri Jan 18, 2013 7:44 pm
by Duketown
ehaldur,

You might try the following before uploading the news module
- Rename the directory News to ie MyNews
- Rename MyNews\News.module.php to MyNews.module.php
- Rename 'class News extends CMSModule' inside MyNews.module.php to 'class MyNews extends CMSModule'

When done, upload module and test.
Tag {MyNews} will not exist, work. Use {cms_module module=MyNews}

Changing/adding content types may cause problems since they are part of the core.

Duketown

Re: How to install a copy of the News module?

Posted: Fri Jan 18, 2013 8:50 pm
by Jos
I don't think that will be enough... think of renaming the database tables too in the various files, etc.

Re: How to install a copy of the News module?

Posted: Sun Jan 20, 2013 3:39 pm
by Duketown
Correctly added Jos.
The advantage will be that whenever you want to delete module MyNews, you can. Without renaming the internaly used files, you will also delete the News related tables and thus have to restore from back up.

Thanks for the heads up.

Duketown

Re: How to install a copy of the News module?

Posted: Thu Jan 31, 2013 8:14 pm
by Dr.CSS
I use PSPad editor to do a search/replace to change News to a different module altogether, but there is one part that you may not see in News.module.php [nN]ews there are 4 lines that have this...

Re: How to install a copy of the News module?

Posted: Fri Feb 08, 2013 11:18 am
by psy
Speaking from experience, it is a PITA to copy/rename modules especially when it comes to upgrades.

My advice for you would be to create a new module, eg using ListIt2.

Re: How to install a copy of the News module?

Posted: Tue Dec 10, 2013 5:11 pm
by totophe
Or MCFactory :-)

Re: How to install a copy of the News module?

Posted: Tue Dec 10, 2013 6:05 pm
by Wishbone
If for some reason, I need two, I use News and CGBlog. I usually just use categories for one or the other.