[solved] show newsbox only if news page is active

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

[solved] show newsbox only if news page is active

Post by thomahawk »

Hello fellow CMSMS'ers

I hope this is the right place to ask. Recently it has become a bit difficult to understand all the forum categories.

Well. I have a news page on a website where not many news will be posted. So we will deactivate the news page if nothing important is going on. My idea is to also have a newsbox showing on the start page, but only if the news page is active.

I thought I could simply make a tag on the start page, like this: {menu includeprefix="news" template="newsbox"} and make a {news} tag in the "newsbox" menu template. But it did not work, so obviously a menu template has no access to {news}.

Maybe I need to put in a smarty code on the startpage, which works like: if menu item "news" == active, show {news summarytemplate="x"}

But I know not enough about smarty. Can someone help me with this? Or other recommendations?

Thank you,
Thom
Last edited by thomahawk on Mon Dec 24, 2012 8:24 am, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: show newsbox only if news page is active

Post by Rolf »

Does this help? http://docs.cmsmadesimple.org/layout/ex ... e-template
Look into the sidebar gcb

Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

Re: show newsbox only if news page is active

Post by thomahawk »

Hi Rolf
Thanks for the suggestion. Basically it seems, that sidebar thing includes a tag who shows news if there are any (active). It is not really what I wanted. I prefer editors can control all news display just by activate/deactivate the news page, instead of deactivate each news article.

But I finally found a solution. I made the frontpage newsbox a Global Content Block, it calls an article summary template
{news number='4' summarytemplate='news-liste'}

I created a menu template which only calls for the Global Content Block.

Finally on the front page, I call the menu template for one single page entry
{menu template="newsbox" items="news"}

It works. When I deactivate the "News" page, the news box also disappears. CMS made simple is just so great!

Thank you
Thomas
Post Reply

Return to “CMSMS Core”