Textpattern CMS support forum
Space in custom fields
I use values from custom fields in urls. Many of the values contain spaces. For example “Mount Fuji”.
Unfortunately, this doesn’t validate:
Bad value https://www.oldphotosjapan.com/photos/?location=Mount Fuji for attribute href on element a: Illegal character in query: space is not allowed.
I also use these values as regular text, so can not add a hyphen or
%20… Besides, it would be impossible to make sure that all potential users add that to the values.
Any ideas for fixing this?
Re: Space in custom fields
etc wrote #332227:
You can try
<txp:custom_field name="my_cf" escape="url" />...
Thanks. That works perfectly!