Forum

Thread tagged as: Question, Addons, Field-Types

Hide extension & default URL using pagelist field type

Hi everyone

Happy Friday!

I'm using the following field type addon so the client can choose a Perch page to link to

<perch:content id="url" type="pagelist" label="Page to link" output="pageurl" />

...which is working perfectly.

Question is how to i get it to not output the URL extension (so /page.php becomes just /page).

Plus if the client selects the home page how can I output just the leading slash rather than /index.php?

Thanking you all.

Glen

Glen Piggott

Glen Piggott 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Like so:

<perch:content id="url" type="pagelist" label="Page to link" output="pageurl" replace=".php|" />

Of course! - Thanks Drew