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, Ed, biapar, Willr, Ingo, swaiba

$SiteConfig.XX in Widget template?

Go to End

10 Posts   3361 Views

Matty Balaam

Community Member, 74 Posts

2 December 2011 at 8:31pm

Edited: 02/12/2011 8:31pm

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

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 :

Go to Top