Jump to content

add a new css for ie6 in the default Prestashop theme


Recommended Posts

Hi out there,

Hope someone can help with the following problem.

Does anyone know how to add an another css besides global.css. I want a seperate css to IE6.
I think i need this code:

<!--[if lte IE 6]> <link href="/themes/yourtheme/css/ie6_only.css" rel="stylesheet" type="text/css"> 

but where and how?

Thanks

Link to comment
Share on other sites

Thanks for your reply.

It dosen't work. Have i placed it wrong?


<html >
   <head>
       <title>{$meta_title|escape:'htmlall':'UTF-8'}</title>
{if isset($meta_description) AND $meta_description}
       <meta name="description" content="{$meta_description|escape:htmlall:'UTF-8'}" />
{/if}
{if isset($meta_keywords) AND $meta_keywords}
       <meta name="keywords" content="{$meta_keywords|escape:htmlall:'UTF-8'}" />
{/if}
       <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
       <meta name="generator" content="PrestaShop" />
       <meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />
       <link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico" />
       <link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico" />
{if isset($css_files)}
   {foreach from=$css_files key=css_uri item=media}
   <link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
   {/foreach}


{/if}

<link href="/themes/New Valueshop/css/ie6_only.css" rel="stylesheet" type="text/css"><![endif]—>

       [removed][removed]

Link to comment
Share on other sites

Place it right below

 

<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />




After that, should looks like this:


<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
<link href="/themes/New Valueshop/css/ie6_only.css" rel="stylesheet" type="text/css"><![endif]—>

Link to comment
Share on other sites

Nice it's working now without the lte. I ended up with this code and it's working perfect

{if isset($css_files)}
{foreach from=$css_files key=css_uri item=media}
<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
<link href="/themes/newvalueshop/css/ie6_global.css" rel="stylesheet" type="text/css"><![endif]—>
{/foreach}

{/if}



Thanks for your time.

Regards
Mike

Link to comment
Share on other sites

Have I placed the new code correct?

{if isset($css_files)}

{foreach from=$css_files key=css_uri item=media}

<!--[if !IE]><!--><link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" /><!--<link href="/themes/newvalueshop/css/ie6_tester.css" rel="stylesheet" type="text/css"><![endif]—>

{/foreach}

{/if}



Unfortunately this it not working but the chances that i have placed it wrong is big.

Link to comment
Share on other sites

Hi Rocky,
Will you try to give me an example? I'am confused and don't what to do. I have tried a lot things and i'am affraid that I mixing it all together.

<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta name="generator" content="PrestaShop" />
<meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico" />
{if isset($css_files)}
{foreach from=$css_files key=css_uri item=media}
<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
{/foreach}

{/if}



The code above is the deafult settings but how will you link it from here?

Thank you in advance

Link to comment
Share on other sites

<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta name="generator" content="PrestaShop" />
<meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico" />
{if isset($css_files)}
{foreach from=$css_files key=css_uri item=media}
<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
{/foreach}

{/if}
<link href="/themes/newvalueshop/css/ie6_tester.css" rel="stylesheet" type="text/css"><![endif]—>

Link to comment
Share on other sites

  • 4 weeks later...

Hello,

If it can help, I think there was a letter missing in <!--[if IE 6]>, that's why it didn 't work. What works for me is:


<!--[if IE 6]><link href="/themes/mytemplate/css/ie6_global.css" rel="stylesheet" type="text/css"><![endif]-->


and you can use a different template for ie6
Link to comment
Share on other sites

  • 5 months later...
  • 8 months later...

a bit of revival but in case someone needs this:

 

- top examples are mostly missing the conditional statement for ie only css

- don't put the conditional css in the loop but under the if

 

{if isset($css_files)}
{foreach from=$css_files key=css_uri item=media}
<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
{/foreach}
{/if}
--PLACE IT HERE--

 

 

- this works for default theme

<!*--[if IE 6]> <link href="{$content_dir}themes/prestashop/css/ie6.css" rel="stylesheet" type="text/css"> <!*[endif]-->

 

 

just remove the stars (*) in the comment signs

 

also: don't forget you are editing template files, so clear smarty cache and compile folders to apply changes

Link to comment
Share on other sites

  • 9 months later...

a bit of revival but in case someone needs this:

 

- top examples are mostly missing the conditional statement for ie only css

- don't put the conditional css in the loop but under the if

 

{if isset($css_files)}

{foreach from=$css_files key=css_uri item=media}

<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />

{/foreach}

{/if}

--PLACE IT HERE--

 

 

- this works for default theme

<!*--[if IE 6]> <link href="{$content_dir}themes/prestashop/css/ie6.css" rel="stylesheet" type="text/css"> <!*[endif]-->

 

 

just remove the stars (*) in the comment signs

 

also: don't forget you are editing template files, so clear smarty cache and compile folders to apply changes

 

Thanks.

This was useful to me. :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...