I help my friend to modified his web. I'd like to give his web some changes in css.
I tried to load additional css with this method '$this->document->addStyle'
At default theme it work perfect but in his template it seems wont load properly.
What may cause this things happen?
why not just using the (default and custom template) stylesheet.css an add style-content there?
They have to be modified both (the same way) in order to present changes in the default template as well as in the Custom Template.
Ernie
They have to be modified both (the same way) in order to present changes in the default template as well as in the Custom Template.
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
for global css, in:
catalog/controller/common/header.php
you could add:
or if you wanna be more specific, you could apply styles to information pages by add the following to:
catalog/controller/information/information.php
in this case, the css file would be loaded if the information id = 10.
catalog/controller/common/header.php
you could add:
Code: Select all
//load custom css
$this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template'). '/stylesheet/custom.css');
catalog/controller/information/information.php
Code: Select all
if ( isset($this->request->get['information_id']) && $this->request->get['information_id'] == '10') {
$this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template'). '/stylesheet/pagename.css');
}
Open catalog\view\theme\your_theme\template\common\header.tplxemox wrote:I tried to load additional css with this method '$this->document->addStyle'
At default theme it work perfect but in his template it seems wont load properly.
Make sure code below is available.
Code: Select all
<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
Who is online
Users browsing this forum: Bing [Bot] and 396 guests