Forum

Thread tagged as: Question

Trying to replace a space with %20

Hi, I'm trying to use replace within a link so that any spaces are replaced with %20, like so...

replace=" |%20"

So...

https://mywebsite.com/link to page

becomes

https://mywebsite.com/link%20to%20page

but unfortunately it's not working and the spaces are being outputted.

Many thanks

Glen

Glen Piggott

Glen Piggott 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Try urlencode or escape attributes

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Like Drew mentioned: urlencode="true" should do the trick. From the docs:

The urlencode attribute converts the value of a field to a URL-encoded version. e.g. changing spaces into %20.