Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2014-01-30 14:49:53
- 630126
- New Member
- From: Czech republic
- Registered: 2014-01-21
- Posts: 6
Two different templates for form and listform
Hi all!
I can not English sorry :D
I have for example section “clanky” and this section uses the template “page1”.On the page “page1” i have tag <txp:article form=“clanek” listform=“post” />.
I want to use a another style template for form=“clanek” and for listform=“post”, because when I put to the template anything, is displayed also in form “clanek”.
One picture says more than 1000 words. http://s27.postimg.org/y01olbnyr/Bez_n_zvu.png
Thanks all
Last edited by 630126 (2014-01-30 14:50:14)
Offline
Re: Two different templates for form and listform
Hi!
Check these tags: txp:if_article_list and its counterpart: txp:if_individual_article
A quick example:
<txp:if_individual_article>
We are in individual article context. Let's print some article tags: <txp:title />, <txp:body />
<txp:else />
We are in article list context.
Let's print some articles:
<txp:article>
<txp:title />, <txp:body />
</txp:article>
</txp:if_individual_article>
Now, the same logic, but using if_article_list:
<txp:if_article_list>
We are in article list context.
Let's print some articles:
<txp:article>
<txp:title />, <txp:body />
</txp:article>
<txp:else />
We are in individual article context. Let's print some article tags: <txp:title />, <txp:body />
</txp:if_article_list>
Offline
#3 2014-01-31 12:30:17
- 630126
- New Member
- From: Czech republic
- Registered: 2014-01-21
- Posts: 6
Re: Two different templates for form and listform
Yeaah, this is exactly what I was looking for. Big thanks :)
Offline