How do you skip adding the google analytics-snippet when you are developing?
- Code: Select all
define( ‘K_LIVE’, ‘0’ );
Then, in couch/addons/kfunctions.php, use Couch’s $CTX class to set a global variable according to your new config constant.
- Code: Select all
$CTX->set(‘k_live’, K_LIVE, ‘global’);
That will give you a k_live variable to use in your project. For instance:
- Code: Select all
<head>
<cms:if k_live>
// show Google Analytics snippet
</cms:if>
</head>