Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Sections that don't appear on the default page and Categories
I’m working on a site in which I only want “blog” articles on the front page. I have sections that I don’t want to appear on the front page. But if they don’t appear on the front page, then when I click the category each article in a section is assigned to, the category appears blank. It only lists articles when that section appears on the default (front) page. Why is that and how can I fix it? I’m sure I’m missing something simple. I’m using 4.7 beta 2 if it makes any difference.
james
Offline
Re: Sections that don't appear on the default page and Categories
If your categorised files are assigned to a section, you need to add the section to your category links to make the category filtering apply using the section’s page template rather than the default (home) section’s page template.
Depending on how you’ve constructed your category links, you can:
- add the attribute
section="my-section"
to the<txp:category title="1" link="1" />
tag - add the attribute
this_section="1"
to the<txp:category title="1" link="1" />
tag. This is better if your code applies to several sections as it will respond to whatever is the current section in the url. - manually construct your section links:
<a href="/<txp:section />?c=<txp:category />"><txp:category title="1" /></a>
.
You may need to adapt your respective section’s page template to accommodate category filtering.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Sections that don't appear on the default page and Categories
Thanks, jakob, that worked great!
james
Offline
Re: Sections that don't appear on the default page and Categories
If you want to disable the “frontpage” section filtering, try frontpage
attribute:
<txp:article frontpage="" />
Offline