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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Get properties of a specific page in the site tree


Go to End


2 Posts   1935 Views

Avatar
pingu

Community Member, 75 Posts

11 May 2009 at 12:37am

Edited: 11/05/2009 3:34am

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

Community Member, 75 Posts

11 May 2009 at 3:34am

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 %>