Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-18 10:20:11

satsilem
Member
Registered: 2006-09-20
Posts: 19

conditional tags in one page

OK one more question
(sorry for making so many questions but I am convinced tha TXP is the right tool for a lot of projects and I would like to learn the most of it)

ok I would like on one of my pages to have three diferrent states:
1. when you load the page you see a small wellcome text and a list of article categories which are links
2. when you select select a category you see a list of all articles that live in this category
3. when you select an article you see the full article

some notes:
- I think I can’t use the condition if category because the article categories are not static.
- actually the main problem is that there is a if article and if article list but what about the first state?
- all these state are for the same section and must work in the same page
thank you one more time for your help

Offline

#2 2007-01-18 16:09:17

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: conditional tags in one page

This should work…

<txp:if_category>
  <txp:article/>
<txp:else/>
  Welcome!
  <txp:category_list section="your_section">
</txp:if_category>

The above does not have a contingency for permlinks without categories, if it doesn’t, this definitely will work (uses a plugin called glx_if );

<glx_if_section_frontpage />
  Welcome!
  <txp:category_list section="your_section">
<txp:else/>
  <txp:article limit="5" form ="my_form"/>
</glx_if_section_frontpage />

You control how individual articles and article lists are dsiplayed in “my_form” with the conditionals <txp:if_individual_article/> and <txp:if_article_list/>

Hope this helps.

Offline

#3 2007-01-19 09:59:01

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: conditional tags in one page

You control how individual articles and article lists are dsiplayed in “my_form” with the conditionals…

Alternately, you can use both the form and listform attributes.

(There’s sometimes several different ways of acheiving the same result, you just pick what works in the simplest way for the given situation.)

Offline

#4 2007-01-19 15:52:56

satsilem
Member
Registered: 2006-09-20
Posts: 19

Re: conditional tags in one page

Ok I will try this to see if it works I will write you back to let you know.

Thanks for the advice

Offline

Board footer

Powered by FluxBB