clean up a title for url use
This is an open discussion with 1 reply, filed under Troubleshooting.
Search
I wonder if you could approach it from the opposite end. Rather than specifying what characters you want to remove, you could specify only characters you want to include.
Using the EXSLT str:tokenize function you can split a string into individual characters. I imagine you could then loop through each of these, and only keep those that match your string above.
To make a string URL-friendly you could also look at a urlencode() function. The EXSLT function is not supported on LibXSLT so can't be used, but I have another template bookmarked that should work: url-encode
Create an account or sign in to comment.
Page and entry titles automatically get a clean handle, by the core of symphony. However I have an application here where I need to clean title nodes into url-bar usable text. I could remove redundant spaces, put all lowercase, and replace spaces and dots with hyphens, like so:
However since the app is multi language, I also would need to translate-add- all kind of special characters
Is there a more simple way of doing this?