Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-24 18:06:53

maurovignati
New Member
Registered: 2008-03-24
Posts: 6

Rotate (alternate) articles on the same page

Hi,
I have the following code on my “agenda” section page:

<txp:article_custom form="article_home" id="6" />

<txp:if_category name="januar2008">
<h2><txp:category title="1" /> 2008</h2>
<table class="agendatable">
<txp:article_custom section="agenda" category="januar2008" form="agenda_entry" />
</table>
</txp:if_category>

The idea is: the article id=“6” must be the landing article for the section-page “agenda”. Then I have some links on the right side of the page (archive), and when you click a link (in this example “januar2008”) the article id=“6” must disappear and the list of articles in the category “janaur2008” must appear.

I have tried differents solutions with if/else statements like:

Number 1

<txp:if_article_list>
<txp:if_category name="januar2008">
<h2><txp:category title="1" /> 2008</h2>
<table class="agendatable">
<txp:article_custom section="agenda" category="januar2008" form="agenda_entry" />
</table>
</txp:if_category>
<txp:else />
<txp:article_custom form="article_home" id="6" />

Number 2:

<txp:if_individual_article>
<txp:article_custom form="article_home" id="6" />
</txp:if_individual_article>
<h2><txp:category title="1" /> 2008</h2>
<table class="agendatable">
<txp:article_custom section="agenda" category="januar2008" form="agenda_entry" />
</table>
</txp:if_category>

Number 3:

<txp:if_individual_article>
<txp:article_custom form="article_home" id="6" />
<txp:else />
<h2><txp:category title="1" /> 2008</h2>
<table class="agendatable">
<txp:article_custom section="agenda" category="januar2008" form="agenda_entry" />
</table>
</txp:if_category>
</txp:if_individual_article>

None of those solutions work. The page test is the following:

http://vignati.ch/stagecoach/agenda/

When you land you will find the article id=“6”. Than you click over “2008” on the right side, and choose “Januar”. The article in this category will be published under the id=“6” article.

Any help would be very appreciate!
Many thanks
Mauro

(Edit: added code markup. -Mary)

Last edited by Mary (2008-03-24 19:59:11)

Offline

#2 2008-03-24 20:05:02

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

Re: Rotate (alternate) articles on the same page

<txp:if_article_list>
	<txp:if_category>
		<h2><txp:category title="1" /></h2>
		<table class="agendatable">
		<txp:article form="agenda_entry" />
		</table>
	<txp:else />
		<txp:article_custom form="article_home" id="6" />
	</txp:if_category>
<txp:else />
	<txp:article form="agenda_entry" />
</txp:if_article_list>

Offline

#3 2008-03-24 20:11:01

maurovignati
New Member
Registered: 2008-03-24
Posts: 6

Re: Rotate (alternate) articles on the same page

Hi Mary,
Many thanks twice!!, for the solution and for the markup added to my post :-) I will know study the double <txp:else />, not so clear at this moment.

Mauro

Offline

Board footer

Powered by FluxBB