Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-15 14:24:14

CharlieC
New Member
Registered: 2006-11-15
Posts: 2

Getting catagory links to actually show the correct catagory

Hi

I’ve set up this site using textpattern. I have a number of categories (listed on the right of the page) and drop each article into either one or two of these categories were applicable.

If I click the links on the right the correct articles are listed (you can see the name(s) of the catagory each article is in just under the ‘List URL’ and above the body text).

The format of the url the category list gives me is this: http://www.toptentoptenlists.com/article/?c=Apple

When I tried to make the two category names in each article into links using <txp:category1 link=1>, the url’s they produced were like this: http://www.toptentoptenlists.com/category/apple/

The problem comes when I access the page using a link formated as above (/category/apple/) if you look at the catagory names in each article most are not supposed to be there, it seems to be a random list of articles rather than a specific one relating to the correct category.

Can anyone tell me what I need to do to get these links to work?

I am using 4.04 with txp:article_custom for each article and txp:category_list for the list on the right and txp:category1 & txp:category2 for the category names in each article

Thanks

CC

Offline

#2 2006-11-15 14:56:05

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

Re: Getting catagory links to actually show the correct catagory

<txp:category1 /> and <txp:category2 /> list your articles from those categories on the front page. So this is because you only have a <txp:article_custom /> tag on your page for displaying articles on the front page.

You can do two things:

1. Put this on your page instead of your article_custom tag(s):

<txp:if_category>
<txp:article form="..." limit="..." />
<txp:else />
here the article_custom tag(s) you already have
</txp:if_category>

2. Or have the category links in the articles create the same urls as the category list in the menu: in your article form, replace <txp:category1 /> with:

<a href="<txp:site_url /><txp:section />/?c="<txp:category1 />"><txp:category1 title="1" /></a>

(and the same for category2 of course).

Last edited by els (2006-11-15 14:56:46)

Offline

Board footer

Powered by FluxBB