Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-09-01 21:55:56
- parlour
- Member
- From: Germany
- Registered: 2006-09-01
- Posts: 20
If "On Front Page?" is off, displaying category pages doesn't work
Hello,
I don’t want the articles of one section to show up on the front page. If I then turn off “On Front Page?” for this particular section, the categories (the pages for these categories) also won’t “work” any longer, i.e. if I select a certain category the articles in this category which are also in the section that is not shown on the front page won’t show up there in the (category) article list.
Is this the default behaviour, or did I break anything? If this is the default behaviour, how can I change it? (There is one problem: I can’t solve the problem with .htaccess magic, that’s not supported on my webspace.)
Offline
#2 2006-09-01 22:14:41
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: If "On Front Page?" is off, displaying category pages doesn't work
This is default behaviour. Because category pages use the front page by default, articles in those sections set to not appear on the front page are not shown. To display all articles in your categories on the home page, use txp:article_custom instead, in combination with txp:if_category.
Alternatively, you can make the category pages use their own section page, see here.
Last edited by els (2006-09-01 22:16:26)
Offline
#3 2006-09-02 04:39:54
- parlour
- Member
- From: Germany
- Registered: 2006-09-01
- Posts: 20
Re: If "On Front Page?" is off, displaying category pages doesn't work
Thanks! It seems to work with txp:if_category. However I have yet to figure out how this txp:article_custom works. At the moment I’m simply using
<code>(…)
<txp:if_individual_article>
<txp:article />
</txp:if_individual_article>
<txp:if_category>
<txp:article />
</txp:if_category>
(…)</code>
for displaying articles. Quite obviously this won’t display any articles at all on my front page, no matter which section they are in. That’s an acceptable solution for my problem at the moment, but maybe not for the future. (Who knows)
I guess it’s possible to somehow manage doing what I want with additionally using txp:article_custom (as you said) but I couldn’t figure out what you can do with txp:article_custom. At least I couldn’t find anything that helps in this case.
Offline
#4 2006-09-02 08:50:56
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: If "On Front Page?" is off, displaying category pages doesn't work
You’d better do something like this:
<code>
<txp:if_category>
<txp:else />
<txp:article />
</txp:if_category></code> This part is for displaying articles on the front page.
<code>
<txp:if_category name=“cat1”>
<txp:article_custom category=“cat1” />
</txp:if_category></code> This part is for displaying a list of articles in category ‘cat1’, if there are articles in that category that are in sections set to not to appear on the front page, they will still be shown here.
The difference between <txp:article /> and <txp:article_custom /> is that the former is context sensitive, meaning that for example on a section page it will only display articles from that section, on a category page only articles from that category, etcetera. With <txp:article_custom section="blah" category="blahblah" /> you can put whatever articles you want wherever you want them.
Offline
#5 2006-09-02 10:08:23
- parlour
- Member
- From: Germany
- Registered: 2006-09-01
- Posts: 20
Re: If "On Front Page?" is off, displaying category pages doesn't work
Thank you, that should help solving my problem!
Offline