Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-27 08:40:37

ss19
New Member
Registered: 2007-02-12
Posts: 7

What happens after a category link is clicked ?

Sorry again for this newbie question.

I created a list of categories and some articles which have the category1 field assigned. The article name is the same as the category name.

using this code I can get a list of the categories when I request the section page:

<txp:category_list label=“Categories” section=“Sectors” wraptag=“p” break=“br” />

When I click on the category name, I should get the article with the same name as the category ? To get this, I added the following code:

<txp:if_individual_article>

<txp:article form=“default” />
</txp:if_individual_article>

But nothing happens when I click on the category name. So the question is:
what happens after a category link is clicked, and how to make it happen ?

Thanks once again for your help.

Offline

#2 2007-02-27 18:47:43

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

Re: What happens after a category link is clicked ?

When you click on a category link, you get a list of articles in that category. Since in your code you are only telling Textpattern how to display an individual article, you don’t get anything at the moment. Try this:

<txp:if_individual_article>
<txp:article form="default" />
<txp:else />
<txp:article form="your_article_list_form" limit="99" />
</txp:if_individual_article>

In case your individual articles and article lists use the same article form, all you need is

<txp:article form="whatever" limit="whatever" />

because the article tag is context sensitive, so it “knows” what to display: a single article, a category list or a section list, depending on the requested url.

(BTW you can leave out form="default" because that is the default value for the attribute.)

Offline

#3 2007-03-01 08:23:11

valpc
Member
Registered: 2007-03-01
Posts: 18

Re: What happens after a category link is clicked ?

The same thing happens to me. When I click on a category name, the default page is returned. I want the page that I use to list my articles. Should I have a section called ‘category’ that uses the page I want ?

Where does the <txp:if_individual_article>… code need to be for the correct listing to show ?

I’m a newbie too btw.

Offline

Board footer

Powered by FluxBB