Jump to:

23478 Posts in 18950 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Page property access in Controller

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 449 Views
  • Lazarus404
    Community Member
    71 Posts

    Page property access in Controller Link to this post

    Hi guys,

    Okay, so, I've decided, to make life easy for the site admin, to default custom properties in a new page to match that of the home page. This way, the page doesn't look nasty if they've forgotten to add anything. This works great for single items, as I can just use

    <% if Property %>
    <% else %>
    <% control Page(home) %>
    <% end_if %>

    However, a problem arises if the property is an array, as I can't nest control statements, and using

    <% control Page(home).Property %>

    doesn't work. The question is, then; how can I use the property of some other page in a control statement in a template?


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.