Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
6584 Vizualizări

I want to override the website template to be able to use my own favicon on website in Odoo 9.

I have created a custom module website_favicon with the following structure:

__init__.py (empty)

__openerp__.py

views

    - website_templates.xml 

static 

    -  src

        - img 

            favicon.ico 

In  __openerp__.py I put {
    'name': "Website Favicon",
    'version': '1.0.0',
    'author': 'Me',
    'category': 'Custom',
    'description': '''Website Favicon''',
    'depends': ['website'],
    'data': [
        'views/website_templates.xml',
        ],
    'installable': True
}

In website_templates.xml I put

<?xml version="1.0" encoding="utf-8"?>
<openerp>
 <data>
  <template id="website_favicon" inherit_id="website.layout" name="Website Favicon">
         <xpath expr="//meta[@name='keywords']" position="after">
          <link rel="shortcut icon" href="/website_favicon/static/src/img/favicon.ico" type="image/x-icon"/>
         </xpath>
     </template>
 </data>
</openerp>

The module installed successfully and I see the <link.../> code being inserted in the page source, but I don't see the new favicon on my website. Could you advice?

Imagine profil
Abandonează
Cel mai bun răspuns

Hi, 

Please check this

https://youtu.be/mX8WSUnBOIU

Hope it helps,

Thanks

Imagine profil
Abandonează
Cel mai bun răspuns

normally I do position="replace". It's what I use for Odoo8 though. I'll try this in Odoo 9 and let you know. Below is the template.


<template id="site_layout_home" inherit_id="website.layout" name="Site Home layout" priority="17">

<xpath expr="//head//title" position="replace">

<title>My Title</title>

</xpath>

<xpath expr="//head//link" position="replace">

<link rel="shortcut icon" href="path/to/fav.ico" type="image/x-icon"/>

</xpath>

</template>



Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
apr. 25
4456
2
nov. 16
6441
3
feb. 23
21517
2
mar. 20
4075
3
iun. 17
6076