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.

General Questions

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

How to use <% control Page(my page) %>


Reply

3 Posts   630 Views

Avatar
Happysadhu

28 July 2009 at 12:22pm Community Member, 33 Posts

Hi,
I'm trying to retrieve the $Title of my ArticleHolder page to display on my homepage using...

<% control Page(ArticleHolder) %><h3>$Title</h3><% end_control %>

But I'm getting no output - nothing.

Any ideas anyone,
Sam

Avatar
Willr

28 July 2009 at 9:14pm Forum Moderator, 5511 Posts

<% control Page() %> requires the URL Segment of the page, not the classname. So you would use it as <% control Page(articles) %> if your ArticleHolder page has the urlsegment 'articles'

Avatar
Happysadhu

29 July 2009 at 3:43am Community Member, 33 Posts

Hi,
Thanks for your quick response. It worked!

Sam