Page 1 of 1

[solved] show newsbox only if news page is active

Posted: Sat Dec 22, 2012 8:29 pm
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

Re: show newsbox only if news page is active

Posted: Sat Dec 22, 2012 8:40 pm
by Rolf
Does this help? http://docs.cmsmadesimple.org/layout/ex ... e-template
Look into the sidebar gcb

Rolf

Re: show newsbox only if news page is active

Posted: Mon Dec 24, 2012 8:23 am
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