Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2009-03-06 13:01:06
- RazvanPavel
- New Member
- Registered: 2009-02-18
- Posts: 6
Custom Category Page
Hya again everyone,
I have this offers page, every entry is in a category (apartments, offices stuff like that).
On the offers page I’m displaying the last 5 entries from the offers section in a main content area and the category list in a sidebar. When someone clicks on a category I want to list all the entries form that category, problem is my default page outputs some article_custom stuff only for the home page, and from what I noticed (I’m kinda new to txp) the category stuff uses the default page to output data (from what i’ve seen in other txp templates).
My question is: How can I make this category listing using a special category page?
Offline
#2 2009-03-06 13:44:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Custom Category Page
You can display the category listing on a section page (in your case ‘offers’?), by using the section
attribute (section="offers"
) in the links to your category pages (either <txp:category1 />
, <txp:category2 />
, <txp:category />
or <txp:category_list />
).
Or you can display them on the home page, and put your code inside conditional tags, like this:
<txp:if_category>
your code for the category pages
<txp:else />
your code for the home page
</txp:if_category>
Offline
#3 2009-03-06 13:57:56
- RazvanPavel
- New Member
- Registered: 2009-02-18
- Posts: 6
Re: Custom Category Page
Thanks a lot for the tip. Got the category listing done with that, and you got me looking into txp if statements and I found if_individual_article witch helped me a lot. Thanks a lot for your help :)
Offline
#4 2009-03-06 15:07:56
- RazvanPavel
- New Member
- Registered: 2009-02-18
- Posts: 6
Re: Custom Category Page
Seems my problem with this listing isn’t over yet: My categories are grouped by parents and subparents, i would like to click a parent category and get a listing of all the elements in it (subparents). How can I achieve this?
I can’t use the 2nd category because I already use it for a sell/rent feature.
Offline
Pages: 1