Textpattern $url_title
Posted on: 02.24.2005
So… one of the things that was keeping me from posting more on this site is that my url scheme with zem_rewrite is pretty complicated.
I always have to remember to fill in the “URL-only title” field with the correct scheme or else my pages might not work properly. It sucks.
But, there is hope. TXP RC3 now auto generates the “URL-only title” field if it is empty. The problem is that zem_rewrite does not work with RC3 and will probably, according to zem, NOT be converted to work with TXP 1.0 Final. This is not a good thing.
First off, the new clean URL structure that is built into RC3 is not what I thought it would be. It uses the zem_rewrite technology but it does not support “normal” URL schemes. By “normal” I mean:
Article = /{section}/{category}/{title}/
Category = /{section}/{category}/
RC3 uses the following for article and category display. Notice the extra “category” in the second line?:
Article = /{title}/
Category = /{section}/category/{category}/
Uhhhg… that blows.
My fingers are crossed that zem somehow allows for a more configurable URL scheme so that I can build sites the way that I want rather than a generic TXP way. PLEEEEEEASE!
So, in the mean time, I’ve modified my TXP install so that all my new posts use the RC3 code to auto generate the “URL-only title” field. All I did was edit the following files:
publish/taghandlers.php
Comment out the entire function stripSpace($text). I just put a // in front of each line in the function.
lib/txplib_misc.php
Add 2 new functions at the end of the file but still inside the ?>. Here’s the new functions: function stripSpace($text), function dumbDown($str). You can find these new functions in txplib_misc.php from the current TXP RC3 updates through SVN.







