Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-12-22 09:56:00

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

If articles > n then ...

Hello,
I have to check whether a section contains 2 or more articles, in order to dynamically display a submenu.
Is that feasible? thanks

Offline

#2 2010-12-22 10:07:03

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

Re: If articles > n then ...

Try this:

<txp:variable name="show_submenu" value='<txp:article_custom section="your-section" limit="1" offset="2">flag</txp:article_custom>' />
<txp:if_variable name="show_submenu" value="" />
   <!-- nothing here -->
<txp:else />
   <!-- submenu code here -->
</txp:if_variable>

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB