Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[SOLVED] Listing Categories, Sub-Categories, and Excerpts
I think that my brain just isn’t working correctly, but I need some help.
I have a large number of articles in one section. They’ll all in a good number of sub-categories. On the main section page, i’d like the articles to display as below. Of course, I want the parent category and sub category names to be automatically generated.
Thanks for the help.
Parent Category 1 Name
-sub Category 1a Name
—article 1 excerpt
—article 2 excerpt
—article 3 excerpt
-sub Category 1b Name
—article 1 excerpt
—article 2 excerpt
—article 3 excerpt
-sub Category 1c Name
—article 1 excerpt
—article 2 excerpt
—article 3 excerpt
Parent Category 2 Name
-sub Category 2a Name
—article 1 excerpt
—article 2 excerpt
—article 3 excerpt
-sub Category 2b Name
—article 1 excerpt
—article 2 excerpt
—article 3 excerpt
-sub Category 2c Name
—article 1 excerpt
—article 2 excerpt
—article 3 excerpt
Offline
Re: [SOLVED] Listing Categories, Sub-Categories, and Excerpts
Hi Clay,
Wanted the same thing a few weeks ago. Check it out. It supports Categories>Sub-Categories>Articles but it can be changed to drill even deeper if required.
You will need to change
<li><txp:permlink><txp:title /></txp:permlink></li>
to
<li><txp:excerpt /></li>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] Listing Categories, Sub-Categories, and Excerpts
thanks. here’s another question:
what about something like this:
<txp:category_list><txp:article_custom limit="1" /><txp:excerpt /></txp:article_custom></txp:category_list>
i think that’s a simplified version of what you’re using. would that return ONE article for every ONE category in the list?
In my test, it’s only returning an article for the last category in the list.
any ideas?
——
UPDATE
so, I’m using children categories in this list, and it seems that it’s simply putting the latest article from the parent category at the end of the list, regardless of what child category it’s in.
Last edited by claywso (2010-04-20 11:57:20)
Offline
Re: [SOLVED] Listing Categories, Sub-Categories, and Excerpts
claywso wrote:
thanks. here’s another question:
what about something like this:
<txp:category_list><txp:article_custom limit="1" /><txp:excerpt /></txp:article_custom></txp:category_list>
…
so, I’m using children categories in this list, and it seems that it’s simply putting the latest article from the parent category at the end of the list, regardless of what child category it’s in.
It is because of limit="1"
What happens if you change it to limit="999"
?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] Listing Categories, Sub-Categories, and Excerpts
same thing, no matter what the limit. here’s the full code of what i’m using.
<txp:category_list parent="elementary-schools" exclude="elementary-schools" label="Elementary Schools" labeltag="h3" />
<txp:article_custom category='<txp:category />' break="li" wraptag="ul" limit="999">
<txp:permlink><txp:excerpt /></txp:permlink>
</txp:article_custom>
</txp:category_list>
Last edited by claywso (2010-04-20 13:13:52)
Offline
Re: [SOLVED] Listing Categories, Sub-Categories, and Excerpts
Hi Clay you’re self closing the category_list
Try
<txp:category_list parent="elementary-schools" exclude="elementary-schools" label="Elementary Schools" labeltag="h3">
<txp:article_custom category='<txp:category />' break="li" wraptag="ul" limit="999">
<txp:permlink><txp:excerpt /></txp:permlink>
</txp:article_custom>
</txp:category_list>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] Listing Categories, Sub-Categories, and Excerpts
ah ha! gotcha. thanks! clay
Offline