Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-06-21 21:21:24

jamesco
New Member
Registered: 2010-06-21
Posts: 2

Dividing articles by Category in a strange way...

Hello, first time Textpattern’er working on my first site. My problem is this:

I have a page in my portfolio for my projects. On this page, the projects should be divided by category ( art / design / web). What I thought would work was to add three <txp:article> tags on the main projects page, to have one that pulls the projects for each category using the same form. However, this is failing. It displays the works properly and divided by category, but when I click on one to see its’ individual page there are errors and nothing looks proper.

I guess it’s not right to use three <txp:article> tags to pull articles from the same section. Now I’m thinking this should all be done through forms, but I’m not sure. I hope this is clear…

Offline

#2 2010-06-21 21:35:36

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Dividing articles by Category in a strange way...

It’s because <txp:article /> is context sensitive, meaning that on an individual article page it will only display that individual article. (And on a section page, only articles from that section; on a category page articles from that category; on a search results page… you get the point.)

Use article_custom instead:

<txp:if_article_list>
   <txp:article_custom category="art" />
   <txp:article_custom category="design" />
   <txp:article_custom category="web" />
<txp:else />
   <txp:article />
</txp:if_article_list>

Offline

#3 2010-06-21 22:33:29

jamesco
New Member
Registered: 2010-06-21
Posts: 2

Re: Dividing articles by Category in a strange way...

There we go! One more Textpattern fundamental in my brain. Thanks!

Offline

Board footer

Powered by FluxBB