Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-29 14:55:31

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

Clean category urls when using if_category?

Is it possible to get clean category urls when using if_category? If not what method is this possible?

The method I am using which will display my category’s url as mysite.com/section/?c=category-name. I want mysite.com/section/category-name

This is the controller for the section:

<txp:if_individual_article>
<txp:output_form form="s-features-i" />
<txp:else />
<txp:if_category>
<txp:output_form form="s-features-c" />
<txp:else />
<txp:output_form form="s-features-f" />
</txp:if_category>
</txp:if_individual_article>

This is what gets called in the if_category form of s-features-c

<txp:article form="a-feature" allowoverride="0" status="sticky" />

Art Rogue – Fine Art Photography

Offline

#2 2010-12-05 12:58:41

ibob
Member
From: Finland
Registered: 2010-06-14
Posts: 35

Re: Clean category urls when using if_category?

Same issue here! I’m using Textpattern 4.3 and gbp_permanent_links 0.14.6.

Situation goes like this:
Url: http://www.someaddress.fi/section/foo

<txp:category /> ( Echoes "foo")

<txp:if_category> Category Found
<txp:else /> Category Not Found
</txp:if_category>

Will echo “Category Not Found”.

It works okay if I change Url http://www.someaddress.fi/section/?c=foo, bit ugly tho and it’s also weird that <txp:category /> can get the correct parameter value even without “?c=” but <txp:if_category> wont. Is this issue or just feature?

Offline

#3 2010-12-05 14:23:50

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

Re: Clean category urls when using if_category?

It’s a known plugin issue.

Workaround:

<txp:variable name="catname" value='<txp:page_url type="c" />' />
<txp:if_variable name="catname" value="">
   // not a category page
<txp:else />
   // category page
</txp:if_variable>

Edit: I guess <txp:category /> instead of <txp:page_url type="c" /> works just as well…

Last edited by els (2010-12-05 14:28:37)

Offline

#4 2010-12-05 15:01:26

ibob
Member
From: Finland
Registered: 2010-06-14
Posts: 35

Re: Clean category urls when using if_category?

Thanks Els!

Offline

Board footer

Powered by FluxBB