Is it possible to install the News Module but have it only appear when there actually is news? i.e. if there are no news items, I don't want the news header to show up without any content.
I have tried searching for this in the forum but didn't find anything; maybe someone else can point me in the right direction for this.
News module not showing when no News
Re: News module not showing when no News
This is not an answer, but an additional request/desirable for the News module.
Would be fabulous to be able to have 'default' message that displays if there are no current entries.
Something to the effect, 'No recent News, please check the News archives'.
Just a thought.
Would be fabulous to be able to have 'default' message that displays if there are no current entries.
Something to the effect, 'No recent News, please check the News archives'.
Just a thought.

Re: News module not showing when no News
Took a quick second to think this through - here's one way to achieve the latter request (mine).
Edit the 'Summary' template that you are using. I placed the header 'NEWS' within here as well at the top of the page.
I then just entered a new smarty. Here's the snippet below:
You could add onto the lang/en_US.php file to include a new variable, maybe $lang['nonews'] to assign the html used above, then call it within the summary template using {$nonews}.
Edit the 'Summary' template that you are using. I placed the header 'NEWS' within here as well at the top of the page.
I then just entered a new smarty
Code: Select all
{if}{/if}
Code: Select all
{if pagecount < 1}
<p>Please check our news archives for a list of recent entries.<br />
<a href="/news/">View 'News'</a></p>
{/if}
Re: News module not showing when no News
Further to the previous post, the first request could be achieved by removing the default
That appears within the page template, and relocating it to the top of the 'Summary' template, and wrap it within the following code:
Basically, if there's no entry, there's no $pagecount.
Code: Select all
<h2>News</h2>
Code: Select all
{if $pagecount => 1}
<h2>News</h2>
{/if}