Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-06-18 16:43:37

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

Messy categories' links

Hi guys, I am having a problem with categories links in a TXP blog.
First of all, I don’t remember how to set up archive pages… I know, I am sorry, but I’m not asking you to write it here. Just a link to read is enough.
Finally, in my blog sidebar, I am using cbs_category_list plugin to create categories link list but its generated links are something like http://mywebsite.com/blog/?c=news
Why is it messy? Shouldn’t it be something like http://mywebsite.com/blog/category/news ?

Offline

#2 2011-06-18 16:51:06

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Messy categories' links

caruso_g wrote:

Why is it messy? Shouldn’t it be something like http://mywebsite.com/blog/category/news ?

Unfortunately, no. Textpattern doesn’t provide that type of build in clean URLs for categories. Only categories displayed using the frontpage (default section/page) use clean format. Categories using different section will use messy format.

Offline

#3 2011-06-18 17:03:18

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

Re: Messy categories' links

caruso_g wrote:

but its generated links are something like http://mywebsite.com/blog/?c=news
Why is it messy? Shouldn’t it be something like http://mywebsite.com/blog/category/news ?

I used to have the same question/problem when I was using categories

Here’s the code I used to produce clean urls but also to only list categories with articles

<ul id="categorylist" class="list">
<li><a href="<txp:site_url />">Home</a></li>
<txp:category_list break="">
<txp:variable name="hasarticles" value='<txp:article_custom category=''<txp:category />'' limit="1" />' />
<txp:if_variable name="hasarticles" value="">
<txp:else />
<li><txp:category title="1" link="1" section="default" /></li>
</txp:category_list>
</txp:if_variable>
</ul>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2011-06-19 00:14:15

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

Re: Messy categories' links

You can create clean URLs with gbp_permanent_links (e.g. /section-name/category-name/ and /section-name/category-name/article-title).

Offline

Board footer

Powered by FluxBB