Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-21 20:45:26

Cap'n Refsmmat
New Member
Registered: 2006-10-21
Posts: 9

Categories set to not appear on front page show no articles listed

Right, I’m messing with textpattern on localhost right now, and I’ve found a rather goofy problem.

If I try to set a category to not appear on the front page (so I can let my front page have only a “welcome to…” article on it), then going to that category’s listing (i.e. localhost/textpattern/category/Name) shows nothing, even though there are posts in that category. Once the category is set to display on the front page, however, the articles do show up in the category listing, but also on the front page, which I don’t want.

How do I fix it?

Offline

#2 2006-10-21 20:52:52

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Categories set to not appear on front page show no articles listed

Are you confusing categories with sections?
/ (= frontpage)
/your_section
/category/your_category

Offline

#3 2006-10-22 01:58:22

Cap'n Refsmmat
New Member
Registered: 2006-10-21
Posts: 9

Re: Categories set to not appear on front page show no articles listed

The /textpattern/ part of the URL is the name of the folder the install is in, not a section name.

Edit: Oh, right. I meant if I set a section to not appear on the front page, any articles in that section will not be displayed on the page for their respective category.

Last edited by Cap'n Refsmmat (2006-10-22 02:27:07)

Offline

#4 2006-10-22 04:03:28

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Categories set to not appear on front page show no articles listed

Oh, right. I meant if I set a section to not appear on the front page, any articles in that section will not be displayed on the page for their respective category.

The /category/blah listing is a bit goofy. It’s basically the front page, which is why the ‘on front page’ setting affects it (think of example.com/category/foo as equivalent to example.com/?c=foo and it makes more sense). It’s not great, but we can’t really change its behaviour for reasons of backwards compatibility.

You can link to list of category articles on a specific section’s page with a tag like <txp:category_list section="mysection" />, or on the current section’s page with <txp:category_list this_section=1 />. The category tag works in a similar way, <txp:category name="mycategory" section="mysection" link=1 />, or <txp:category name="mycategory" this_section=1 link=1 />.

Last edited by zem (2006-10-22 04:04:22)


Alex

Offline

#5 2006-10-22 18:40:55

Cap'n Refsmmat
New Member
Registered: 2006-10-21
Posts: 9

Re: Categories set to not appear on front page show no articles listed

Okay. Supposing I’m trying to make a site which organizes mostly-static articles in a hierarchical fashion. I want to be able to have a user click on a category name, browse through the articles in that category, and see the categories underneath that one. I’d also like only one article to show up on the front page.

How do I go about doing this? I am capable of making a plugin, so that’s not a problem as it is. I just don’t understand what’s going on here.

Offline

#6 2006-10-22 19:30:42

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

Re: Categories set to not appear on front page show no articles listed

You’d best set all sections that you want to be displayed in category lists to display on the front page.
Then on your page:

<txp:if_category>
<txp:article listform="..." limit="..." /> <!-- for the category list -->
<txp:else />
<txp:article_custom id="..." form="..." /> <!-- your article for the front page -->
</txp:if_category>

Offline

#7 2006-10-22 19:39:10

Cap'n Refsmmat
New Member
Registered: 2006-10-21
Posts: 9

Re: Categories set to not appear on front page show no articles listed

Then when I try to view an individual article, it shows up as the main page article instead :-p

Offline

#8 2006-10-22 19:49:42

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

Re: Categories set to not appear on front page show no articles listed

Sorry!

<txp:if_section name="">
<txp:if_category>
<txp:article listform="..." limit="..." /> <!-- for the category list -->
<txp:else />
<txp:article_custom id="..." form="..." /> <!-- your article for the front page -->
</txp:if_category>
<txp:else />
<txp:article form="..." listform="..." limit="..." /> <!-- specify with listform and form how you want article lists and individual articles to be displayed on section pages -->
<txp:if_section>

Last edited by els (2006-10-22 19:50:50)

Offline

#9 2006-10-22 21:08:19

Cap'n Refsmmat
New Member
Registered: 2006-10-21
Posts: 9

Re: Categories set to not appear on front page show no articles listed

Ah, thanks. It works!

Now I just need to make a simple plugin so I can have a sort of category hierarchy and browse through categories and articles.

Offline

Board footer

Powered by FluxBB