Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-01-02 14:14:57
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
<txp:if_section> and articles layout
my homepage is in 2 different languages. at the moment i just want to duplicate estonian content into english version pages. so i made like this:
<txp:if_section name="news">
<txp:article_custom section="uudised" limit="99" />
</txp:if_section>
<txp:if_section name="articles">
<txp:article_custom section="artiklid" limit="99" />
</txp:if_section>
and so on...
it displays right sections but it doesnt display articles layout like i do in estonian pages.
for example: in estonian section “uudised” i use:
<txp:article limit="1" />
<txp:if_article_list>
<ul>
<txp:article form="article_b" offset="1" limit="90" />
</ul>
</txp:if_article_list>
this code displays last (newest) article with excerpt and below it list of older articles (only titles) here
but in english ver. it displays all articles with excerpts, no list of article titles.
do i need write something more between <txp:if_section> tags or it’s just not possible because of <txp:article_custom /> tag?
Offline
Re: <txp:if_section> and articles layout
Easy and simple. If you don’t style txp:article_custom, it will only show a regular list. So lets do something about it:
<txp:if_section name="news">
<txp:article_custom section="uudised" limit="1" />
<ul>
<txp:article_custom section="uudised" limit="90" offset="1" form="article_b" />
</ul>
</txp:if_section>
<txp:if_section name="articles">
<txp:article_custom section="artiklid" limit="1" />
<ul>
<txp:article_custom section="artiklid" limit="90" offset="1" form="article_b" /> <!-- Added here form and offset attribute -->
</ul>
</txp:if_section>
Cheers!
Last edited by Gocom (2008-01-02 20:32:30)
Offline
#3 2008-01-03 10:55:38
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: <txp:if_section> and articles layout
Gocom wrote:
Easy and simple.
in your hands all turns to gold ;) thanks again!
one more little question. Is this code below – i use in page template – correct and optimal in your opinion or you would make it little bit differently?
<txp:article limit="1" />
<txp:if_article_list>
<ul>
<txp:article form="article_b" offset="1" limit="90" />
</ul>
</txp:if_article_list>
Offline
Offline
#5 2008-01-03 13:12:56
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: <txp:if_section> and articles layout
one more thing :)
in estonian default page i want to make something like this:
<txp:if_section name="">
<txp:article limit="1" />
<txp:if_article_list>
<ul><txp:article form="article_b" offset="1" limit="90" /></ul>
</txp:if_article_list>
</txp:if_section>
<txp:if_section name="artiklid">
<txp:article limit="3" />
<txp:if_article_list>
<ul><txp:article form="article_b" offset="3" limit="90" /></ul>
</txp:if_article_list>
</txp:if_section>
else
<txp:article limit="1" />
but i don’t know how exactly the right code should look like?
Offline
Re: <txp:if_section> and articles layout
For “else” you need to use <txp:else />
however it is sitting outside any “if” statement so you might need to use something like:-
<txp:if_section name=",artiklid">
<txp:else />
<txp:article limit="1" />
</txp:if_section>
Last edited by thebombsite (2008-01-03 16:15:40)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#7 2008-01-04 10:53:46
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: <txp:if_section> and articles layout
thebombsite wrote:
bc. <txp:if_section name=”,artiklid”>
<txp:else />
<txp:article limit=“1” />
</txp:if_section>
but, where i write this :
<txp:if_article_list>
<ul><txp:article form="article_b" offset="1" limit="90" /></ul>
</txp:if_article_list>
didn’t you miss something?
Offline
Re: <txp:if_section> and articles layout
Stuart was meaning:
<txp:if_section name="">
<txp:article limit="1" />
<txp:if_article_list>
<ul><txp:article form="article_b" offset="1" limit="90" /></ul>
</txp:if_article_list>
</txp:if_section>
<txp:if_section name="artiklid">
<txp:article limit="3" />
<txp:if_article_list>
<ul><txp:article form="article_b" offset="3" limit="90" /></ul>
</txp:if_article_list>
</txp:if_section>
<txp:if_section name=",artiklid">
<txp:else />
<txp:article limit="1" />
</txp:if_section>
Cheers!
Offline
#9 2008-01-04 12:04:11
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: <txp:if_section> and articles layout
aa, i see. but, would this:
<txp:if_section name="">
<txp:article limit="1" />
<txp:if_article_list>
<ul><txp:article form="article_b" offset="1" limit="90" /></ul>
</txp:if_article_list>
<txp:else />
<txp:article limit="1" />
</txp:if_section>
<txp:if_section name="artiklid">
<txp:article limit="3" />
<txp:if_article_list>
<ul><txp:article form="article_b" offset="3" limit="90" /></ul>
</txp:if_article_list>
<txp:else />
<txp:article limit="1" />
</txp:if_section>
also do the job? is it same?
Offline
Offline
#11 2008-01-04 14:09:24
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: <txp:if_section> and articles layout
Gocom wrote:
No, because it would output two
<txp:article limit="1" />
when not in frontpage nor section named artiklid.
so you say, it’s a best (and only?) solution? ok.
and when i want to add another differently designed section, i just write it name <txp:if_section name=”,artiklid…here….”>
<txp:else />
<txp:article limit=“1” />
</txp:if_section>
?
Offline
Re: <txp:if_section> and articles layout
Gallex wrote:
so you say, it’s a best (and only?) solution? ok.
Everything can be done by millions of ways, and in future the amount just gets bigger ;) But, yeah by this far it’s the best solution.
and when i want to add another differently designed section, i just write it name <txp:if_section name=”,artiklid…here….”>
Exatly.
Cheers!
Last edited by Gocom (2008-01-04 14:53:47)
Offline
Pages: 1