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

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Maxii
New Member
New Member
Posts: 6
Joined: Wed Jun 28, 2017 9:19 am

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

Post 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?
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

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

Post 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.
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
Maxii
New Member
New Member
Posts: 6
Joined: Wed Jun 28, 2017 9:19 am

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

Post 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!
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

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

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

Return to “The Lounge”