Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2016-07-03 08:07:44

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Re: Making a unique home page

Hi

For me i allways use

<txp:if_section name="">

it works for me, the only thing is when putting links to category i use this :

<txp:category name="mycat" section="mysection" />

Cheers

Offline

#14 2016-07-04 08:01:44

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Making a unique home page

Bloke wrote #300144:

[categories …] Yes. And search results. And author pages…

More clarity on the magic default page. :)
It seems I often forget as much about Textpattern shamanism as I remember when caught up in my other pursuits.
Thanks Bloke!

Alternatively, you can redirect <txp:category /> URLs (including category1 and category2) to the current section so they can be handled by the current page template, by using the this_section="1" attribute or the section="some-section-name" attribute to send them to an arbitrary section. You can do the same with <txp:author /> links, and the <txp:search_input /> tag to redirect the output to a different template.

This is how I always handled it (because it’s how I learned to do it), so content was treated in context of the section it belonged to.

The downside to using categories in this manner is that you lose the clean URL syntax, as you get URLs like this: example.org/section?c=category_name... … [or] you can clean those up with .htaccess rules or the gbp_permanent_links plugin.

That latter approach using gbp_permanent_links is how I always did it, but I’m dropping gbp_permanent_links in all sites now in favor of core handling, so it will be homepage conditionals or .htaccess handling.

The end result is that I like category URLs ending up like this .../section/category/article-title, because it supports the mental model of hierarchical organization of content, even if it’s not really organized like that in a DB/relational way.

Dragonz, Michael … Nice options too!

Offline

Board footer

Powered by FluxBB