e107help.org Q&A
0 like 0 dislike
I'm trying to add custom fonts to a Voux themed e107 website, but I can't work out where to place the
<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" /> statement that will call my font definitions. Everything I read says it should go in the <Head> of my site's main HTML, but Voux doesn't seem to have an HTML index.
e107 version 2.1.9.
closed
in Core by (7 points)

1 Answer

0 like 0 dislike
Best answer

Fonts are css file. I am sure that way how to include css file is in official docs. 

Maybe this can help too:

https://www.e107.sk/knowledge_base/2-solid-include-css-files/?content.71

but it's outdated. Many new things was added and changed from that time.

No e107 theme has index.html file, e107 is not static, content is generated. You can look at header_template.php how head part is created.  

by (1.7k points) 10 36 47
selected by
Awesome response, thanks @Jimako. You have set me in the right direction .

In the case of my site, \e107_Core\Templates\Header_Default.php is just the place I was looking for to include my rel= statement.

Thanks,

Mark
Please read up on the developer documentation on e107.org. You can include css files either in your theme or plugin files. Do not edit the head_default.php file, because it will get overwritten with updates and you'll have to re-apply your changes.
Moc is right. I didn't advice you to change core file, I just pointed you where to look if you want to learn how it works.

You shouldn't change Voux theme directly either. It is core theme and next update will override your changes.

100% understood, and thanks for the follow-up. Perhaps I wasn't clear enough previously. @Jimako's initial reply was enough to help me undertand that I needed to make my changes only via CSS, but his reference to head_default.php (and a quick read through that file) was the thing that helped me understand that the CSS files get dynamically called sort of 'on the fly' by PHP (not HTML). 

By the way, I embarked on all of this because the theme I have chosen is specifically coded to use five distinct fonts (Lato, Monserrat, Open Sans, Playfair Display and Raleway) that were not actually installed when I installed the website. 

With your help, I have now:

  1. Downloaded and added all five webfonts into a new \fonts sub-directory of the theme directory.
  2. Added their required @font-face definitions at the very top of the style.css that already existed in the theme directory.

I'm pleased to say it is all working beautifully. 

I will keep a backup of the amended style.css, along with some file notes, in case any future update messes with the default style.css. 

Thanks again,

Mark.

 

Hi, thank you for this comment, I had feeling that Moc comment is more for me than for you. My English is not good and many times I don't get everything right.  But really thank you for your feedback, user like you helps me to continue thanks their answers.

By the way:

I will keep a backup of the amended style.css, along with some file notes, in case any future update messes with the default style.css. 

You don't need to do this. e107 has already way how to solve this.  If your changes are only in css, just create file with name style_custom.css and put all your changes there. You can check that this file is loaded directly after style.css if exists.   This way next update just overrride style.css but your changes in new file will not be touched.

If you change php file, you should make copy of theme. There is tool in Theme manager for this (maybe in developer mode), but I do it manually so I don't know if (how) that tool works.  Just use CTRL-V and CTRL-C on Voux folder, then change name of copied folder to f.e. Voux2 and open theme.xml and change name element to Voux2.  It's all. 

You’ve just been a great help to me again, @Jimako. I didn’t know about style_custom.css. That’s a brilliant feature, and I’ll definitely use it.

I haven’t changed any php.

Thanks again,

Mark.
Glad you got it sorted out Mark :)
Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
844 questions
1,242 answers
2,155 comments
5,546 users