Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions

Get properties of a specific page in the site tree


Reply

2 Posts   1157 Views

Avatar
pingu

11 May 2009 at 12:37am (Last edited: 11 May 2009 3:34am), Community Member, 75 Posts

Hi,

I'm wondering if it's possible in a template to get the properties of a specific page in the site tree?

The scenario is that in the site tree I have a page called "Mailing List" (which appears in the navigation) - this is a redirector page that links to an external site which manages the site's mailing list.

I'm creating an include in templates - MailingListButton - which needs to link to the mailing list's URL. This button will show up on selected pages. I don't want to hard-code the URL as I want to retain flexibility in case the client decides to use a different ESP in the future.

Is there a control that I can use to access the redirctor page's URL in my MailingListButton template?

Avatar
pingu

11 May 2009 at 3:34am Community Member, 75 Posts

Ah, nevermind - it was in the docs.
http://doc.silverstripe.org/doku.php?id=built-in-page-controls&s=page%20controls

<% control Page(my-page) %>$Title<% end_control %>