Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2006-04-03 22:10:29
- kelper
- Member
- Registered: 2005-05-27
- Posts: 28
Re: How to clean up category URL's?
Hey,
Alright, I got it to work, but it took me lots of experimenting. It’s sort of a different method than was suggested.
<code>
<txp:if_category title=“1”>
<txp:article_custom form=“category_list” limit=“10” category=“Green-Tea” sortby=“Posted” sortdir=“desc” />
<txp:else />
<txp:output_form form=“static_front” />
</txp:if_category>
<txp:if_category title=“2”>
<txp:article_custom form=“category_list” limit=“10” category=“Benefit-of-Green-Tea” sortby=“Posted” sortdir=“desc” />
<txp:else />
<txp:output_form form=“static_front” />
</txp:if_category>
</code>
The form called “static_front” has all of the static website information that is displayed on the front page, but if Textpattern picks up that it is in a category, it forgets about the static information and reverts to displaying the latest articles from the “Green-Tea” category.
Hmm, there still seems to be a problem, when I’m at the category URL of Benefit-of-Green-Tea, for some reason, the articles in Green-Tea show up before it.
They’ll be two forms displayed of “static_front”, too.
Last edited by kelper (2006-04-03 22:22:13)
Offline
#14 2006-04-04 14:24:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to clean up category URL's?
kelper wrote:
Hmm, there still seems to be a problem, when I’m at the category URL of Benefit-of-Green-Tea, for some reason, the articles in Green-Tea show up before it.
And probably when you’re on the Green-Tea category page, the articles in Benefit-of-Green-Tea show up after it… ;)
Use the name attribute in <txp:if_category />
, title is not supposed to work here.
They’ll be two forms displayed of “static_front”, too.
That’s because you’re telling it to display twice (with <txp:else />
).
Try this:
<code>
<txp:if_category name=”“>
<txp:else />
<txp:output_form form=“static_front” />
</txp:if_category>
<txp:if_category name=“Green-Tea”>
<txp:article_custom form=“category_list” limit=“10” category=“Green-Tea” sortby=“Posted” sortdir=“desc” />
</txp:if_category>
<txp:if_category name=“Benefit-of-Green-Tea”>
<txp:article_custom form=“category_list” limit=“10” category=“Benefit-of-Green-Tea” sortby=“Posted” sortdir=“desc” />
</txp:if_category>
</code>
Offline
#15 2006-04-04 20:35:11
- kelper
- Member
- Registered: 2005-05-27
- Posts: 28
Re: How to clean up category URL's?
You’re brilliant :)
I’m paranoid about search engine optimization. This is the closest I’ve ever gotten, unfortunately, if I go to www.mydomain.com/category/Green-Tea, nothing comes up, BUT if I do www.mydomain.com/?c=Green-Tea, it works perfectly. Is there anything I can do to remedy this problem?
Offline
#16 2006-04-04 21:23:10
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to clean up category URL's?
Hmm… that’s strange. Are you sure your other clean urls are working?
Offline
#17 2006-04-04 21:29:56
- kelper
- Member
- Registered: 2005-05-27
- Posts: 28
Re: How to clean up category URL's?
Yes, they’re working for the articles.
Offline
#18 2006-04-04 21:35:12
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to clean up category URL's?
I don’t know… TXP takes the word ‘category’ for the url from the language file, so the only thing I can think of is did you change this line category => Category
in your language file? Seems a bit far-fetched though…
Offline
#19 2006-04-04 21:43:09
- kelper
- Member
- Registered: 2005-05-27
- Posts: 28
Re: How to clean up category URL's?
Nope, it’s fine, though. I’ll make do with those URL’s. I got what I wanted in the first place. Thanks.
Offline