Jump to content

Is it possible to set variables for .css files just like we set variables for .tpl files?


Recommended Posts

@JoelWebsites - Here I found a good tutorial comparing LESS and SASS. Prestashop already integrated SASS, we hope that this will be good for the software. I'm seeing several designers saying that LESS is better. ;)  Boths manage css variables and classes on a given library.

 

EDIT: I forgot to mention that there is a third one - Stylus. SASS is the oldest one of css stylesheet langugaes

 

LESS (Apache)

SASS (OS independent)

Stylus (cross platform)

Edited by selectshop.at (see edit history)
  • Like 1
Link to comment
Share on other sites

What i did was i copied my .css code inside the header.tpl inside <script> tags ..so now the css is working as well as i will be include the variable..

 

 

I got the variables set my using this code in hookHeader()

{

 

$smarty = $this->context->smarty;
$smarty->assign(array('id_supplier' =>"JOEL",
'JOEL' =>"Fernandes",
'password' =>"123",
));
 
}
 
 
So now {$JOEL} is global variable that can be used in all the .tpl files
Edited by JoelWebsites (see edit history)
Link to comment
Share on other sites

I got the variables set my using this code in hookHeader() in my module


{


 


$smarty = $this->context->smarty;

$smarty->assign(array('id_supplier' =>"JOEL",

'JOEL' =>"Fernandes",

'password' =>"123",

));

 

you will need to return $this->display(__FILE__, 'header.tpl'); inside public function hookdisplayHeader($params)

incase you want to do it for a module..

 

}

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...