Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-03 20:48:00

jshan
Member
Registered: 2008-01-09
Posts: 67

Logic between Category Link & Page/Form Template?

Hi,

I’ve been trying to solve the puzzel for a long time. It’d be much helpful and appreciated if someone could help me understand the above question. In particular for each individual article in view, I’m using the following code to output all the categroies assigned to that article:

<p>Tag: <txp:rss_unlimited_categories_filedunder linktosection="archive" /></p>

As you can tell from the code, I told TXP to use the page template of section archive for the category link.
E.g.: Poultry is one tag(category from TXP point of view) of an article. When mouse over the category link Poultry, the URL points to http://txpsite-dev/archive/poultry

My question is what I’m supposed to do with poultry so that once the link is clicked, TXP will list all the articles with the tag(Category) Poultry using the page template of section archive?

How to parse poultry from the URL http://txpsite-dev/archive/poultry to what page/form template to render the output presentation?

Thanks a bunch!

Last edited by jshan (2009-03-03 20:50:38)

Offline

#2 2009-03-03 21:21:29

jshan
Member
Registered: 2008-01-09
Posts: 67

Re: Logic between Category Link & Page/Form Template?

forgot to mention that I was expecting to have similar code to the following in the archive page template:

<txp:if_category>
<h2><txp:category title="1" /></h2>
<txp:article form="article_listing" />
</txp:if_category>

In order for this to work, the URL would have to be http://txpsite-dev/category/poultry instead of http://txpsite-dev/archive/poultry. But category is not any section.. I’m so confused…

Last edited by jshan (2009-03-03 21:33:15)

Offline

#3 2009-03-03 21:34:05

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

Re: Logic between Category Link & Page/Form Template?

Normally category links to your ‘archive’ page would look like /archive/?c=category-name, and if you had the code above on your ‘archive’ page, it would display the articles from the right category automatically. Are you sure that page template ‘archive’ is assigned to your section ‘archive’?
I don’t know how rss_unlimited_categories works, if this code doesn’t work for you you might need something else, you’d better ask in the plugin thread then.

Offline

#4 2009-03-03 22:25:59

jshan
Member
Registered: 2008-01-09
Posts: 67

Re: Logic between Category Link & Page/Form Template?

Problem solved with code changed to:

<txp:if_category>
<h2><txp:category title="1" /></h2>
<txp:rss_unlimited_categories_article_list form="article_listing"/>
</txp:if_category>

<txp:rss_unlimited_categories_article_list> replaces TXP article listing using the standard Category1 and Category2 with its new table of unlimited categories. It takes in “category” as one attribute. By default, it’s the current one in request, i.e., same return as <txp:category />

Thanks all the same Els!

Offline

Board footer

Powered by FluxBB