Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-06 13:15:30

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Article view when viewing categories

Hello, when in a section, I have a list of categories on the side courtesy of the cbs_category_list plugin, which displays all the catgeories under the section.

When clicking on the category, I have one article. The article displays in list view. How can I change this?

This is what I have in the page:

<code><txp:if_individual_article>
<!— article page: display the live article —>
<txp:article form=“article” limit=1 />
</txp:if_individual_article>
<txp:if_article_list>
<!— section page: display the sticky article —>
<txp:article status=“sticky” form=“article” limit=1 />
<!— then the rest of the articles —>
<txp:article listform=“list_articles” form=“article” />
</txp:if_article_list></code>

Offline

#2 2005-10-06 21:11:06

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Article view when viewing categories

I should have said: How do I change the article view to that of a single page rather than the list view, when clicking on the category menu item.

There is only one article in each of the categories, so it makes more sense to have it display the article in single page form. If I have more than one article in the category then the list form should be used.

The TXP code works fine for displaying the articles when moving around the section, its only when clicking on the category link I get the list.

For example, I have this for the section:
http://www.example.com/txp/section

And this when I click on the category:
http://www.example.com/txp/section/?c=Category

Last edited by jstubbs (2005-10-07 09:22:25)

Offline

#3 2005-10-07 10:18:55

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Article view when viewing categories

I fixed this affter reading this post:
http://forum.textpattern.com/viewtopic.php?id=11798

I have this now which works well (after getting the very useful glx_if plugin!!):

<code><txp:if_individual_article>
<!— article page: display the live article —>
<txp:article form=“article” limit=1 />
</txp:if_individual_article>
<txp:if_article_list>
<txp:glx_if_section_frontpage>
<!— section page: display the sticky article —>
<txp:article status=“sticky” form=“article” limit=1 />
<!— then the rest of the articles —>
<txp:article listform=“list_articles” form=“article” />
</txp:glx_if_section_frontpage>
<txp:glx_if_category_list>
<txp:article form=“article” />
</txp:glx_if_category_list>
</txp:if_article_list></code>

Might help someone else.

Offline

Board footer

Powered by FluxBB