Support Online : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Importing a new css file

Featured Lock Resolved
Hi,

I would like to import a new CSS (not less) file to my template. I've followed you documentation word by word and added my css file but it's not imported when I view the source code. This is the tutorial I've followed:
http://www.joomshaper.com/documentation/helix/adding-custom-css-and-javascript-files
At the end you've indicated that a line should be added like so $helix->addCSS('custom.css'); but you didn't mention where should it be added to add the new file.

Thank you in advance,

Guy.

6 Answers

Guy Walder

More than a month ago #Permalink
Update:
It seems that the correct code to import a file should be like so:
->addJS('effects.css')
Without the helix at the beginning of the code and without semi-colon.

Rifat Wahid Alif - Staff

More than a month ago #Permalink
Hi,
create your css file in following location: 'templates/your-template/css' and if you css file name is 'custom.css' then you don't need to add this ' $helix->addCSS('custom.css')' code anywhere but if your css file isn't 'custom.css' then you need to add this code in 'templates/yourtemplate/index.php' file after '$this->helix->Header()'. this code.

- Thanks for your understand

Guy Walder

More than a month ago #Permalink
Thank you Rifat,

I've added a new effects.css file to my css template under shaper_helix_ii folder.
Then I've added the following code right after $this->helix->Header() in index.php like so:
$helix->addCSS('effects.css');

The site won't load and I get the following error message:
Parse error: syntax error, unexpected '$helix' (T_VARIABLE) in C:\xampp\htdocs\mysite\templates\shaper_helix_ii\index.php on line 22

When I rename the file to custom.css the file is loaded and it works fine but I really would prefer to name it effects...

Thank you in advance,

Guy.

Rifat Wahid Alif - Staff

More than a month ago #Permalink
Hi,
use this code: $helix->addCSS('effects.css') without ; (semi-colon) hope it will be fixed.

- thanks

Guy Walder

More than a month ago #Permalink
Hi Rifat,

I'm sorry but I've tried to add this line as you've instructed to index.php in my template folder right after $this->helix->Header() and I get the same error.
Where am I'm going wrong here?

I've eventually imported the file ussing:
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/effect.css" type="text/css" />

But I wonder why your method didn't work...


Guy.


There are no replies made for this post yet.
Be one of the first to reply to this post!

Leaderboard (30 days)

Paul Frankowski

Paul Frankowski

Total Accepted Answers: 98
Toufiq

Toufiq

Total Accepted Answers: 51
Sifat

Sifat

Total Accepted Answers: 38
Ofi Khan

Ofi Khan

Total Accepted Answers: 21
Mehtaz Afsana Borsha

Mehtaz Afsana Borsha

Total Accepted Answers: 21

119

Templates

306696

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us