Forum

Thread tagged as: Question

How to output unique page identifier within template?

I need to add some JavaScript for a third party service akin to Disqus to several pages on a site, and need to specify a unique page reference as part of this e.g. a page ID, slug or the full URL would do.

Is there a way of accessing any of this info within a Perch HTML template?

Thanks

Janine Dalton

Janine Dalton 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

This Solution for adding Facebook like buttons is roughly similar.

https://solutions.grabaperch.com/integrations/adding-facebook-like-buttons

Does that help?

Thanks for replying. I know how to use fields like in the Facebook example, but I don't know how to put out page properties like the id or url/slug. Since i first posted i found the showall tag, which shows me the properties are available to use in the template, i just don't know the syntax to output one of these values from showall in the template. I know it's probably in the docs but i can't find it. Thanks for your time

Drew McLellan

Drew McLellan 2638 points
Perch Support

You can just use the ID:

<perch:content id="whatever" />

Thanks Drew - talk about missing the obvious :)