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.


Discuss SilverStripe Widgets.

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

$SiteConfig.XX in Widget template?


10 Posts   1967 Views

Matty Balaam

2 December 2011 at 8:31pm (Last edited: 2 December 2011 8:31pm), Community Member, 69 Posts

There is actually a better way Willr mentioned here:

Use the following code in your widget:

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

Bureau Berg

13 March 2012 at 3:34am (Last edited: 13 March 2012 3:34am), Community Member, 7 Posts

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

In ss Template :