Skip to content


Subversion checkout URL

You can clone with
Download ZIP

SiteCatalyst Advanced

Philip Lawrence edited this page · 1 revision

Adobe SiteCatalyst Yii Extension

This covers advanced usage for the Adobe SiteCatalyst Yii Extension

Getting / Setting configuration within controllers / views

In the event that you need to change or grab the value of a setting, you can do so by calling the setting method.

// Grab the s_account variable
$s_account = Yii::app()->siteCatalyst->setting('s_account');

// Change the s_account variable
$s_account = array('foo', 'bar');
Yii::app()->siteCatalyst->setting('s_account', $s_account);

Multiple SiteCatalyst instances

There are times when you need to have multiple Adobe SiteCatalyst instances on a site. Usually the variables do not line up, different report suite names, etc. Because of this, we should create a separate instance of the SiteCatalyst component in the config files.

In a normal setup, you'd see something like the following in /protected/configs/main.php:

'siteCatalyst' => array(
    'class' => 'ext.TPSiteCatalyst.components.TPSiteCatalyst',
    'rsids' => array(

However in this case, we'd need 2 of these. This creates a problem though - the names of the components are the same and thus the later one would overwrite the first one. Instead, different component names should be created. It is suggested to use something like the vendor's name (if you're using a 3rd party agency) or an internal identifier for that Adobe SiteCatalyst instance. Let's say we're using as an analytics vendor and an in-house solution as the other. We'll call one instance tpSiteCatalyst for the isntance and the other intSiteCatalyst for the internal (or in-house) instance. The configuration will now look like the following:

'tpSiteCatalyst' => array(
    'class' => 'ext.TPSiteCatalyst.components.TPSiteCatalyst',
    'rsids' => array(
    's_codeLocation' => '//',
'intSiteCatalyst' => array(
    'class' => 'ext.TPSiteCatalyst.components.TPSiteCatalyst',
    'rsids' => array(
    's_codeLocation' => '//',

If you should enable autoRender, remember to change the component names:


protected function beforeRender($view)
    $return = parent::beforeRender($view);
    return $return;

Then later on in your controller/view, you could then call the following to set a variable like normal:

Yii::app()->tpSiteCatalyst->prop1 = $someVar;
Yii::app()->intSiteCatalyst->prop45 = $someVar;
Something went wrong with that request. Please try again.