Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-20 20:12:36

tdn
Member
Registered: 2006-02-16
Posts: 58

How do I make pretty links to categories

Hi

Right now my category links links to /blog/?c=CategoryName.

How do I make these links look something like /blog/category/CategoryName?

Offline

#2 2006-10-20 20:53:07

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How do I make pretty links to categories

Is ‘blog’ a section name or is that the root directory (where textpattern is installed)?
If it’s a section, you need a plugin to create those links
If it’s the TXP root dir, then you change the ‘permanent link mode’ to something other than messy in the admin->preferences tab

Last edited by ruud (2006-10-20 20:53:31)

Offline

#3 2006-10-20 20:59:06

tdn
Member
Registered: 2006-02-16
Posts: 58

Re: How do I make pretty links to categories

Textpattern is installed in /blog.

I have already set permanen link mode to: /section/id/title. Shouldn’t that be ok?

Offline

#4 2006-10-20 22:23:06

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

Re: How do I make pretty links to categories

Are you using <txp:popup /> to create the category links? That tag doesn’t create clean url’s (explanation see here). <txp:category_list /> does.

Offline

#5 2006-10-20 22:28:56

tdn
Member
Registered: 2006-02-16
Posts: 58

Re: How do I make pretty links to categories

No. I am making the links by hand. I do not know which tags to use for making a link to a specific category. It is not that I want to make a list of category links. Although that would be nice too!

My default form is pasted here:
http://thomasdamgaard.dk/p/?paste=278

Right now I am using: <a href="/blog/?c=<txp:category1 />"><txp:category1 /></a> and it works. But I was trying to use:
<a href="/blog/category/<txp:category1 />"><txp:category1 /></a> but this gives me a 404 page.

You can see the blog at
http://thomasdamgaard.dk/blog

Offline

#6 2006-10-20 22:36:02

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

Re: How do I make pretty links to categories

Are you using this in an article form to link to the category the article is in? In that case <txp:category1 link="1" title="1" /> will do exactly that. And since clean url’s are definitely working on your site, it should give you links like /category/CategoryName.

Offline

#7 2006-10-20 22:40:58

tdn
Member
Registered: 2006-02-16
Posts: 58

Re: How do I make pretty links to categories

Ok. <txp:category1 link="1" title="1" /> worked fine. Thank you.
I can see that it uses the language pack’s word in the URL. I really don’t like the idea of it doing this. The URLs should be permanent always. Even if the language of the site changes. Also in Danish (and other languages as well) we have chars that are not valid in a URL.

Offline

#8 2006-10-20 22:49:41

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

Re: How do I make pretty links to categories

I can see your point, and I think I’ve seen a thread about this somewhere, just can’t find it again. You could ask about it in the Internationalisation or Danish forum.

But anyway, you can change it in the txp_lang table in the database.

Offline

Board footer

Powered by FluxBB