Jump to content

[SOLVED] Modify {$css_uri} - CSS and SSL issues


pedrodonkey
 Share

Recommended Posts

Hi,

Does anyone know where i can modify this variable

{$css_uri}

for including the CSS files in the header.tpl file?

It seems PS is loading my global.css file using the temporary URL like this:

https://188.65.112.140/~neontech/themes/NeonTechnology/css/global.css



Instead of

/themes/NeonTechnology/css/global.css



And it's causing issues with the security certificate. If i add the certificate exception it works fine but that has to be done manually and isn't convenient.

Using PS 1.3.1.1

Thanks for any help.

Share this post


Link to post
Share on other sites

New to PrestaShop, don't know the answer, but I'd recommend switching to the default theme and then switching back. Hopefully that would reset the path. Otherwise, you could hardcode the css path in header.tpl, not a perfect solution but it works, I've used it to add additional css files when I couldn't find where to add additional css to {$css_uri}.

Share this post


Link to post
Share on other sites

Hey, thanks for the suggestion.

I'll give it a shot tomorrow and see if switching themes makes a difference. You're right about hard coding it into the header.tpl file not being pretty but I ended up doing that for the time being and it works as an easy fix.

Would be nice to know how that css_uri works and where it can be found though.

Share this post


Link to post
Share on other sites

As far as I understand and my smarty knowledge is a bit sketchy here

{$css_uri}

is generated

from the following code

{foreach from=$css_files key=css_uri item=media}
   <link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
   {/foreach}



I think $css_files comes from header.php

http://www.smarty.net/manual/en/language.function.foreach.php

has some detail on smarty for each loops and keys + items

hope this helped in a little way

Share this post


Link to post
Share on other sites

figured a bit more how this works

in header.php

$css_files[_THEME_CSS_DIR_.'global.css'] = 'all';



sets the location of global css

now looking at category.php

this line adds the css needed for category.php

$css_files = array(__PS_BASE_URI__.'css/jquery.cluetip.css' => 'all', _THEME_CSS_DIR_.'scenes.css' => 'all');

so $cssfiles would now be an array containing three locations of css files

which is then translated into html by the foreach loop in header.tpl

so infact $css_uri is not an actual definition

but the location is controlled by _THEME_CSS_DIR_

this is defined in defines.inc.php in 1.3.1

Share this post


Link to post
Share on other sites

Hey bartman,

You pointed me in the right direction. Can't believe i didn't browse through the header.php file before!

The path to the CSS file was set to the URL i posted above by default. IT must have happened when i installed PS using the temp URL

188.65.112.140/~neontech/

whilst the domain name was in the process of being transferred.

Thanks for clearing up how CSS files are defined in PS.

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More