Jump to:

5520 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Same Variables, Many Pages

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

Page: 1
Go to End
Author Topic: 885 Views
  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Same Variables, Many Pages Link to this post

    Hi All,

    I am creating a variable that I want to be able to use across many different pages on the site. How can I achieve this?

  • Howard
    Avatar
    Community Member
    215 Posts

    Re: Same Variables, Many Pages Link to this post

    Just add the variable to Page.php as all the pages use this or expand on it

  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Re: Same Variables, Many Pages Link to this post

    Sorry, when I said variable, I mean Database field. If I say create some content (HTMLText and an uploaded Image) on HomePage.ss, and I want to reuse it on SalePage.ss without retyping it

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Same Variables, Many Pages Link to this post

    <% control Page(home) %>
    $DBFieldName
    <% end_control %>

    885 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.