Drupal: dynamically change site name

Today I needed code that would dynamically set the $site_name variable, changing the site name of a drupal site temporarily on certain nodes.

It took a while to find, but here is a working solution. Somehow it seems a bit ‘wrong’, but it works nonetheless.

$GLOBALS[‘conf’][‘site_name’] = ‘new site name’;

Thank you to: http://drupal.org/node/253447.

Advertisements
Posted in drupal

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: