Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-03 16:49:00

advertizer
New Member
Registered: 2006-03-03
Posts: 7
Website

Display of articles from several categories for one section

Hi all,
Recently I have faced a problem and I can not solve it :(
I need to show of articles from several categories for one section.

I do so:
- I create section “portfolio”;
- As I create some categories: “site”, “video”, “polygraphia”, “outdoor”, “other”;

I create two forms: portf_list: <code> <h2><txp:permlink><txp:title /></txp:permlink></h2> <txp:excerpt /></CODE> portf_ex: <code> <h2><txp:permlink><txp:title /></txp:permlink></h2> <txp:body /> </code>

On page I write such pattern:
<code>
<txp:article_custom form=“portf_ex” category=“site” section=“portfolio” sortby=“Posted” sortdir=“desc” listform=“portf_list” />

… (selecting from others categories)

<txp:article_custom form=“portf_ex” category=“other” section=“portfolio” sortby=“Posted” sortdir=“desc” listform=“portf_list” />
</code>
And nothing occurs, page remains empty :(

Evgeny from site textpattern.ru has offered other variant:

<code><txp:if_section name=“portfolio”> <txp:if_individual_article> <txp:article form=“portf_ex” /> <txp:else /> <txp:article_custom form=“portf_list” category=“site” section=“portfolio” sortby=“Posted” sortdir=“desc” /> … … (selecting from others categories) … <txp:article_custom form=“portf_list” category=“other” section=“portfolio” sortby=“Posted” sortdir=“desc” /> </txp:if_individual_article>
</txp:if_section></code>

This variant too does not help :(
Someone can already solved this problem?

Last edited by advertizer (2006-03-03 16:50:15)

Offline

#2 2006-03-03 17:37:29

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,771
Website

Re: Display of articles from several categories for one section

take a look at the end of the FAQ archive post by zem. Together with the if_different tag you can use article_custom to step through all the articles of a section listing the title of the category only once for each category. I don’t think you need listform for article_custom.

The second variation using if_article_list and txp:article_custom form=“portf_list” then txp:else and txp:article form=“portf_ex” should work (should theoretically also work the other way round using if_individual_article as suggested on textpattern.ru).


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB