kgardener Posted December 12, 2011 Share Posted December 12, 2011 Hi all, any help on this problem would be massively appreciated, I am essentially looking to add a css file into the header.tpl if the http_referer equals utm_medium=cpc, now obviously in a php file I would use the below however I am not too familiar with Smarty and the best way of acheiving this in the header.tpl file <?php session_start(); if (!isset($_SESSION["origURL"])) $_SESSION["origURL"] = $_SERVER["HTTP_REFERER"]; ?> <?php $_SESSION['org_referer'] = $_SERVER['HTTP_REFERER']; if (strpos($_SESSION['origURL'], 'utm_medium%3Dcpc') !== false) echo "<link href="/themes/theme1/css/standard.css" rel="stylesheet" type="text/css" media="all" />"; else echo "<link href="/themes/theme1/css/ppc.css" rel="stylesheet" type="text/css" media="all" />"; ?> Anyone with any thoughts on this or can point me in the right direction for some good resources to read up on? Link to comment Share on other sites More sharing options...
bellini13 Posted December 14, 2011 Share Posted December 14, 2011 you should create a simple module that performs a hookHeader. Your module will then be notified anytime the header is being created, and you then have the opportunity to add your .css file to the header section, based on your logic. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now