Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
5 Odpowiedzi
24382 Widoki

We run into some basic problems when trying to build our custom website with Odoo. Hopefully we find help here.

I have converted two lettertypes to webfonts which we would like to use on our website. Is there a specific location where we should place these maps? How can we chance the default lettertypes 1 and 2 for our website to these ones?

 

 

Awatar
Odrzuć
Najlepsza odpowiedź

How can i add my custom font in my website?

Awatar
Odrzuć
Autor Najlepsza odpowiedź

(Edi)

Think we figured it out:

If you add the following HTML code at the top of a page via the Odoo HTML editor:

<t t-name="website.PAGENAME">

    <t t-call="website.layout">

        <style>

            h1 {font-family: "Comic Sans MS", cursive, sans-serif; font-size:50px;}

        </style>

    </t>

</t> 

You will see that each H1 text (on that page only) is concverted to comic sans 50px. If you never use H6 on your website you may better declare H6 so you are still flexible to use H1 in the theme lettertype as well on that page if you want.

This method works for all websafe fonts, you can copy paste them here  http://www.w3schools.com/cssref/css_websafe_fonts.asp

We wanted however a different font, at http://www.fontsquirrel.com/tools/webfont-generator you can upload your font (make sure you have the correct licence) and let it generate a web-font kit. Upload the whole kit to your server, in the kit there is a generated stylesheet.css which contains the code you can probably also add to the frontend.css which your theme uses. If you did this the above HTML code should also allow to use that custom font (we are still checking, will update if we are wrong or found out more)

(ignore below comments)

Awatar
Odrzuć
Autor

We now figured it out our selves I think. Via fontsquirrel you can upload a font (make sure you own of use free licence) and have the tool directly creaste an css file in your created package. That css (multiple declarations to support all kind of devices and browsers) file contains the code you can add to the frontend.ss of the theme you want to use it in. Then for each page where you like to use that font only for H1 simply add a piece of code at the start looking like this: t t-name="website.NAMEOFPAGE"> When you now add a buildingblock to that page and add H1 text in that black it is in the custom lettertype. Any H1 text on other pages will still be original font. We are pretty much there but still need to fully validate above method. Maybe good to mention that a lot of web safe fonts are already delivered with Odoo (I write this for noobs like myself) so without adding thing to your CSS file you can already choose a many custom fonts in you pages by for example adding Creates COMIC SANCE in size 50 when choosing H1...this mentod you can also choose another one for H2 etc. Hope it helps somebody who encounters the same question.

Autor

FOR SOME REASON ABOVE COMMENTS MISSES IMPORTENT PARTS OF THE TEXT. I CAN NOT ADD ANOTHER POST TO THIS THREAD TO EXPLAIN HOW TO DO THIS SO IF YOU HAVE THE SAME PROBLEM SIMLY REPLY AND I CAN TRY TO HELP

how to embed custom font in odoo website(browser) ?font-type=Freight ??? how can i add my custom font in website? did you got any proper solution for that??

Powiązane posty Odpowiedzi Widoki Czynność
1
lis 23
5283
1
lis 23
2315
1
lip 20
9864
2
gru 23
4413
1
lis 23
3936