why does serendipity use id-title.html style tags?

Discussion corner for Developers of Serendipity.
Post Reply
Dinges
Regular
Posts: 14
Joined: Fri Aug 12, 2005 3:33 pm

why does serendipity use id-title.html style tags?

Post by Dinges »

why does serendipity use id-title.html style tags?

It seems to use both of the params to find the article, but why, you could use either id or name to find the article :lol:
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: why does serendipity use id-title.html style tags?

Post by garvinhicking »

The id is used for DB lookup. We then know the right entry id, and this saves one additional database lookup for matching a link to an entry. So if a id is present in the URL, Serendipity disregards any title information.

The title is used in the URL for prettyness and readablity and backward-compatibility.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Dinges
Regular
Posts: 14
Joined: Fri Aug 12, 2005 3:33 pm

Post by Dinges »

but if the title is incorrect, it will not fetch the entry :cry:

Is it possible to remove that id?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I don't understand you - if you have the ID in the URL, the title doesn'T matter.

http://blog/archives/5-ignore.html and
http://blog/archives/5-this-is-another-title.html

will both show entry 5. Only if you omit the 5 in the URL and would use a permalink pattern without %id% it would match the title and then

http://blog/archives/ignore.html and
http://blog/archives/ignore-.html

would not yield the same result.

If that is not what you asked, please try to explain it more detailed. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply