Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-25 12:00:54

Mr. Smith
Member
From: Denmark
Registered: 2006-11-10
Posts: 56

Only show news section on front page if there are any news

Hi,

I have no idea what to search for to find the solution, so here goes:

I have a news section on my front page, but this section should only show if there are any news. When I post to my “news”-section, the news’ headline together with a link is shown accordingly, but I only want up-to-date news shown, meaning that when I delete the news article and there are no articles posted to this section at all, the news section should not be displayed at the front page at all.

1) Is it possible to tell Textpattern only to show e.g. a form if there are any articles posted in a specific section?
2) Is it possible to tell Textpattern to write “No news, sorry” if there aren’t any articles posted in a specific section?

I’ve taken a look at the conditional tags, but haven’t found what I am looking for.

Can someone please help? Thanks in advance!


Textpattern n00b

Offline

#2 2009-01-25 12:51:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Only show news section on front page if there are any news

would this help


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2009-01-25 13:21:01

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Only show news section on front page if there are any news

There is also csb_if_newer_than that will only show articles published in a given timeframe. That way they’d be removed automatically.

Offline

#4 2009-01-25 15:33:09

Mr. Smith
Member
From: Denmark
Registered: 2006-11-10
Posts: 56

Re: Only show news section on front page if there are any news

Thank you for your input guys! The if_variable seems to be able to do the trick! I’d better get Textpattern upgraded to 4.0.8 then… :-)


Textpattern n00b

Offline

Board footer

Powered by FluxBB