Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Pulling data from DB to template

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1131 Views
  • hitautodestruct
    Community Member
    19 Posts

    Pulling data from DB to template Link to this post

    I know this should be super easy but I can't get my head about how to do this in the sapphire framework.

    I have a control block:

    <a href="<% control Level(1) %>$Prefix<% end_control %>SomePage">SomePage</a>

    As you can see it simply goes to the top level page and gets the $Prefix field.
    My question is how can I make a function that will do the same thing only with one template command. Something like:

    <a href="{$WritePrefix}SomePage">SomePage</a>

    Or better yet, is there a way to get the prefix from the top level and place it in every <a href=""> ?

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.