Page 1 of 1

[solved] Favicon at all pages using ie9 /...

Posted: Tue Jul 24, 2012 3:13 pm
by map_1961
Hi folks.
In my 1.8.2 installation page favicon is shown on all pages of the site - even in ie9.
In the brand new 1.10.3. installation favicon is shown on home page only (using ie9).
I use this userdefined tag:

Code: Select all

if(isset($params['static']))
   echo '<link rel="shortcut icon" href="'.$params['static'].'" type="image/x-icon" />'."\n";

if(isset($params['animated']))
   echo '<link rel="icon" href="'.$params['animated'].'" type="image/gif" />'."\n";
... and this line in the template:

Code: Select all

{favicon static="images/favicon.ico"}
When i use the absolut path - in template - to the favicon like this...

Code: Select all

{favicon static="http://myserver/images/favicon.ico"}
... the favcion is shown using ie9 on subpages, too. Is there a way to replace the absolute path? Tried...

Code: Select all

{favicon static="[root_url]/images/favicon.ico"}
...already but this doesn't work.

Thanks for help

map_1961

Re: Favicon at all pages using ie9 /doesn't like relative pa

Posted: Tue Jul 24, 2012 5:25 pm
by uniqu3
If you change the UDT to :

Code: Select all

if(isset($params['static']))
   echo '<link rel="shortcut icon" href="' . cmsms()->config['root_url'] . '/' . $params['static'].'" type="image/x-icon" />'."\n";

if(isset($params['animated']))
   echo '<link rel="icon" href="' . cmsms()->config['root_url'] . '/' .$params['animated'].'" type="image/gif" />'."\n";
Root url from config will be included.

Or assign {root_url} tag to variable like:

Code: Select all

{root_url assign='my_root'}
{favicon static="`$my_root`/images/favicon.ico"}

Re: Favicon at all pages using ie9 /doesn't like relative pa

Posted: Wed Jul 25, 2012 7:17 pm
by map_1961
Hey - thank you - great job.

Thanks a lot.

map_1961