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.

Widgets /

Discuss SilverStripe Widgets.

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

$SiteConfig.XX in Widget template?


Go to End
Reply


10 Posts   2122 Views

Avatar
Matty Balaam

Community Member, 69 Posts

2 December 2011 at 8:31pm

Edited: 02/12/2011 8:31pm

There is actually a better way Willr mentioned here:

http://www.silverstripe.org/widgets-2/show/18440

Use the following code in your widget:

function SiteConfig() {
return SiteConfig::current_site_config();
}

Avatar
Bureau Berg

Community Member, 7 Posts

13 March 2012 at 3:34am

Edited: 13/03/2012 3:34am

In PHP :
$config = SiteConfig::current_site_config(); //calling siteConfig values
$config->YouSiteConfigVariableName // get the value of the site config variable/field

In ss Template :
$SiteConfig.YouSiteConfigVariableName

Go to Top