Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-04-05 08:14:28

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 118
Website

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

#2 2018-04-05 08:42:27

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,611
Website

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

#3 2018-04-05 08:51:57

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 118
Website

Re: Sections that don't appear on the default page and Categories

Thanks, jakob, that worked great!

james

Offline

#4 2018-04-05 09:06:38

etc
Developer
Registered: 2010-11-11
Posts: 5,064
Website GitHub

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

Board footer

Powered by FluxBB