Jump to:

3434 Posts in 1026 Topics by 866 members

Template Questions

SilverStripe Forums » Template Questions » Get properties of a specific page in the site tree

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

Page: 1
Go to End
Author Topic: 1143 Views
  • pingu
    Avatar
    Community Member
    75 Posts

    Get properties of a specific page in the site tree Link to this post

    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?

  • pingu
    Avatar
    Community Member
    75 Posts

    Re: Get properties of a specific page in the site tree Link to this post

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

    1143 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.