Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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?
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: Space in custom fields
You can try escape="url"
:
<txp:custom_field name="my_cf" escape="url" />
Offline
Re: Space in custom fields
etc wrote #332227:
You can try
escape="url"
:
<txp:custom_field name="my_cf" escape="url" />...
Thanks. That works perfectly!
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Pages: 1