Page 1 of 1

News Module doesn't hide completly when it's ot checked

Posted: Thu Oct 05, 2017 6:16 am
by Maxii
Hi People,

i have a little problem with my news Module in CMSMS 2.1.6 . We use the CGContentUtils 2.2.2 to add a checkbox in our site manager to display or not the news. The news container in the front end has a brown background. Now if our customer leaves the checkbox checked in the site manager 'news tab' and no news article is published we have a small brown bar in our front end.
For us as a webdesign company it's no problem because we know that the checkbox is there since we have it in every of our websites. But our customer will maybe forget about it in some time.

Is there any solution for this? Or did someone maybe already had this problem?

Re: News Module doesn't hide completly when it's ot checked

Posted: Thu Oct 05, 2017 2:03 pm
by paulbaker
You should be able to resolve this with a change to the template - post the template which shows/hides the news depending on the state of your checkbox. Someone will be along with the right modifications.

Re: News Module doesn't hide completly when it's ot checked

Posted: Wed Oct 11, 2017 6:46 am
by Maxii
Here are two screenshots of everything i have to display/not display the news container.
Hope someone can help me.
engelbach-tmp.JPG
engelbach-tmp-2.JPG
That's all i have written in my main Template for the news container!

Re: News Module doesn't hide completly when it's ot checked

Posted: Wed Oct 11, 2017 7:49 pm
by velden
Some questions and hints:

Code: Select all

{news assign='news_there'}
Why don't you use the the parameters from the {news number=...} tag you actually show a few lines later? Now you call {news} twice and it's possible you DO find an article in the first call you use to check if there's any news while the actual {News number=... category="General"...} returns NO items because of the extra constraints (category).

Why don't you put the {if empty($news_there)} statement not around the whole <div id="news-container">?

Check if the DEFAULT news summary template (or if you're going to follow my advice, the engelback-newsuebersicht template) is returning NOTHING if no items are found. The function empty(...) will return false if a non-empty string is returned. A string of one space (' ') is non-empty too.