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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Same Variables, Many Pages


Go to End


4 Posts   1436 Views

Avatar
DanStephenson

Community Member, 116 Posts

8 May 2009 at 6:26am

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?

Avatar
Howard

Community Member, 215 Posts

8 May 2009 at 1:46pm

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

Avatar
DanStephenson

Community Member, 116 Posts

8 May 2009 at 8:11pm

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

Avatar
Willr

Forum Moderator, 5523 Posts

8 May 2009 at 8:51pm

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