2821
General Support / Re: Google Analytics
« on: September 06, 2012, 08:14:15 AM »
If you need add generic code (show on all pages) into storefront head you can do this 2 ways.
1. Add code to TPL file /storefront/view/default/template/common/head.tpl
This whole file is pulled into <head></head>
2. You can include child block or just code into controller /storefront/controller/common/head.php
This can be done by adding (concatenating) to variable $head
If you need to add some script or CSS to head in some specific page only, you can use addScript or addStyle in that page controller.
These methods will append your script or CSS to the head on on that page.
Example:
1. Add code to TPL file /storefront/view/default/template/common/head.tpl
This whole file is pulled into <head></head>
2. You can include child block or just code into controller /storefront/controller/common/head.php
This can be done by adding (concatenating) to variable $head
If you need to add some script or CSS to head in some specific page only, you can use addScript or addStyle in that page controller.
These methods will append your script or CSS to the head on on that page.
Example:
Code: [Select]
$this->document->addScript(RDIR_TEMPLATE . 'javascript/jqgrid/js/jquery.jqGrid.min.js');
Code: [Select]
$this->document->addStyle(array(
'href' => $this->view->templateResource('/javascript/jquery/star-rating/jquery.rating.css'),
'rel' => 'stylesheet',
'media' => 'screen',
));