Installing the news module with a different name

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
neild

Installing the news module with a different name

Post by neild »

I'm developing a site where I need the news module functionality for 2 additional informational blocks.
Is it possible to install the News Module twice? (It's installed by default)

I've created a module with the Module Maker module, where I mimicked the News Module but its functionless; can someone explained what needs to be done additionally?


thx.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: Installing the news module with a different name

Post by tsw »

well you could copy news module folder to new name (such as own_news) and go through all files and change all references to news to own_news...

but what is that news cant offer you right now?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Installing the news module with a different name

Post by Dr.CSS »

You could use diff. categories and diff. templates to get more than one news block, I've used it 4 diff. ways on one page.
neild

Re: Installing the news module with a different name

Post by neild »

I want to report news that doesn't require 'date' and 'author' for example. Any changes in the current News Module would affect the 'block' everywhere it appears in the site.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Installing the news module with a different name

Post by Dr.CSS »

My favorite part of the news modulew is the ability to show it in diff. formats by changing the summary and detail templates.

To do this you need a screwdriver and hammer...  :D kidding, go to news and look at the default templates copy paste one into notepad make changes by deleting tags you don't want like...

{if $entry->author}

Posted by: {$entry->author}  take out this part or the whole thing, you have to be careful not to leave any stray {if or {/if or each/foreach

{/if}

when you get it the way you like save as somenameforit.tpl and FTP it to your site into the modules/news/templates folder then call it in your news tag  summarytemplate='somenameforit.tpl'  if you just want the detail part to show up you still have to call it summarytemplate= ,it just defaults to a summary template, if you go to Extensions » Modules click the word Help for news it tells this there.

So you can have news all over the site with diff. looks even using it as a blog.
Post Reply

Return to “Developers Discussion”