Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-03 22:53:15

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

If section no category probem

2 articles in the same section
Article 1: section=services
Article 2: section=services category=testimonial

Question: how can I stop article 2 showing in MAIN CONTENT and only show in SIDE BAR?
Any pointers gratefully received, than you, Lee.

————
MAIN CONTENT
<txp:if_section name=“services”>
<txp:article_custom form=“default” section=“services” />
</txp:if_section>

SIDE BAR
<txp:if_section name=“services”>
<txp:article_custom form=“default” section=“services” category=“testimonial”/>
</txp:if_section>
—————-

Offline

#2 2007-04-04 07:20:42

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: If section no category probem

To make it not show in the main content, you can do this in your article form:

<txp:if_category name="testimonial">
  <!-- show nothing -->
<txp:else />
  <!-- article layout here -->
</txp:if_category>

Something similar can be done in the sidebar.

Last edited by ruud (2007-04-04 07:21:00)

Offline

#3 2007-04-04 16:49:38

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: If section no category probem

Ruud’s suggestion is fine, except in the article form you need to use <txp:if_article_category name="testimonial"> instead of <txp:if_category>!

Offline

#4 2007-04-04 17:41:31

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: If section no category probem

thanks both, I’ll give it a go.

Offline

Board footer

Powered by FluxBB