How to install a copy of the News module?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
ehaldur
Forum Members
Forum Members
Posts: 23
Joined: Thu Apr 26, 2012 4:23 pm

How to install a copy of the News module?

Post 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...
Duketown

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

Post 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
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

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

Post by Jos »

I don't think that will be enough... think of renaming the database tables too in the various files, etc.
Duketown

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

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

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

Post 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...
psy
Power Poster
Power Poster
Posts: 463
Joined: Sat Jan 22, 2005 11:19 am

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

Post 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.
totophe
Forum Members
Forum Members
Posts: 63
Joined: Wed Feb 21, 2007 9:30 am

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

Post by totophe »

Or MCFactory :-)
Wishbone
Power Poster
Power Poster
Posts: 1369
Joined: Tue Dec 23, 2008 8:39 pm

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

Post by Wishbone »

If for some reason, I need two, I use News and CGBlog. I usually just use categories for one or the other.
Post Reply

Return to “Developers Discussion”