How do I set a favicon for the web/e-commerce frontend of Odoo 8?
Ideally without changing Odoo core files, i.e. I do not simply want to overwrite addons/web/static/src/img/favicon.ico.
(This is Odoo 8, August 2014. It's likely that it will be easier to change the favicon in future versions.)
You have to override the web module with your own module. You can add a line like
'data': [ 'views/website_templates.xml' ]
in your __openerp__.py.
Put your favicon at static/src/img/favicon.ico and add a template to views/website_templates:
<template id="MYSITE_layout" inherit_id="website.layout" name="MYSITE layout" priority="17">
<xpath expr="//head//link" position="after">
<link rel="shortcut icon" href="/MYSITE_web/static/src/img/favicon.ico" type="image/x-icon"/>
</xpath>
</template>
Favicon is set in <head> html section, that is stored in template, and link there is hardcoded to point to /web/static/src/img/favicon.ico (see here), so if you want to change it you have to change either icon file itself or change proper template to point to icon file you want.
Related
I have created a new Theme for Odoo 12 (in EN and AR), the theme works fine on my Environment. But when the theme is copied to live environment, the EN site loads fine, but the AR site goes Grey completely. Can any suggest how to approach this problem. There is no evident error in console.
According to your question, it is possible CSS, qweb and js can't loads.
please add your CSS Js and qweb properly.
I add an example for css or js load
<odoo>
<template id="assets_backend" name="Demo project" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/module_name/static/src/css/custom.css"/>
<script type="text/javascript" src="/module_name/static/src/js/module_name.js"/>
</xpath>
</template>
</odoo>
I everyone, i have a problem developing a custom module on odoo 10.
When i modify a js or a css, imported into the view.xml in this way
<template id="makeit.assets_common" name="makeit assets common" inherit_id="web.assets_common">
<xpath expr="." position="inside">
<!-- All links to CSS and JS files should be added in here. -->
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/flick/jquery-ui.css"/>
<link href="/makeit/static/src/css/jquery.tagit.css" rel="stylesheet" type="text/css"/>
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.171.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.js"></script>
<script src="//cdn.jsdelivr.net/bluebird/3.5.0/bluebird.min.js"></script>
<t t-call-assets="web.assets_backend" t-css="false"/>
<link rel="stylesheet" href="/makeit/static/src/css/makeit.css"/>
<script type="text/javascript" src="/makeit/static/src/js/custom_js_v93.js"></script>
</xpath>
</template>
as you can see i have to change the name of the custom_js_v93 every time to make it work.
I've tried reloading db, odoo service, module ecc.
any idea? thank you
If your changes are in *.py files, restart the odoo service.
service odoo restart
If your changes are in existing *.xml files, re-install (upgrade) the module.
Apps > Your module > Upgrade
If your changes are in both, the do the both: restart the service then upgrade the module.
I don't think clearing browser cache is necessary, since Odoo automatically generates new *.js files (and removes the old ones) every service start:
http://odoo.example.com/web/content/6045-b6fe286/web.assets_backend.js
^
This is generated
So in your case, just reinstall the module.
Updated:
Try changing to inheritance of inherit_id="web.assets_backend" if it fixes your issue:
<template id="makeit.assets_common" name="makeit assets common" inherit_id="web.assets_common">
to
<template id="makeit.assets_backend" name="makeit assets backend" inherit_id="web.assets_backend">
I'm using the Swashbuckle NuGet package to create Swagger documentation for my API. https://www.nuget.org/packages/Swashbuckle
I'm trying to make some minor changes to the UI - essentially just to add some corporate branding to the header.
I have added two files as embedded resources to my project, in a directory called resources.
These are injected into the UI via:
.EnableSwaggerUi(c =>
{
c.InjectStylesheet(thisAssembly, typeof(SwaggerConfig).Namespace + ".Resources.Swagger.css");
c.InjectJavaScript(thisAssembly, typeof(SwaggerConfig).Namespace + ".Resources.Swagger.js");
}
Which results in the following link being added to rendered page.
<link href="ext/ang_nav_api-Resources-Swagger-css" rel="stylesheet" type="text/css" media="screen">
This is all correct and the stylesheet works as expected.
However the .js script doesn't appear on the client.
Changing the c.InjectJavaScript to c.InjectStylesheet does inject the file as a <link> .. so I'm happy that the file itself is correctly embedded etc.
What could be wrong here?
The .js script will not appear on the client. (not on the way you would expect)
Look closely to the code of index.html:
https://github.com/domaindrivendev/Swashbuckle/blob/8223bedae706fec612c98ebbcee6b2d7033ae349/Swashbuckle.Core/SwaggerUi/CustomAssets/index.html#L98
Your customScripts will be loaded dynamically on the onComplete event
$.getScript(script);
Odoo Warning
Odoo Warning - Warning
You are trying to install incompatible themes:
- Add to css (To be installed)
- Default Theme (Installed)
Please uninstall your current theme before installing another one.
Warning: switching themes may significantly alter the look of your current website pages!
this code i am trying
<template id="styles_compiled" inherit_id="website.assets_frontend">
<xpath expr="link[last()]" position="after">
<link rel="stylesheet" href="/add_css_to_website/static/src/css/custom.css" />
</xpath>
</template>
</data>
I got Solution;
1. Please edit a file 'openerp.py' (main directory) and change the line:.
'category' : 'Theme/Backend', with 'category' : 'Website',
2. Next, run 'Update Apps List' from developer mode.
3. Now you can install the theme.
thanks this is working for me... thanks
I'm using Hippo CMS and trying to implement SEO plugin. I did everything by manual but I don't see any changes and meta tags in rendered results.
My basic layout is:
<#include "/WEB-INF/freemarker/include/imports.ftl">
<html lang="en">
<head>
<meta charset="utf-8"/>
<#hst.headContributions/>
<link rel="stylesheet" href="<#hst.link path="/css/bootstrap.css"/>" type="text/css"/>
<#hst.defineObjects/>
<#if hstRequest.requestContext.cmsRequest>
<link rel="stylesheet" href="<#hst.link path="/css/cms-request.css"/>" type="text/css"/>
</#if>
</head>
And I just enable plugin over Hippo Setup -> features. And sure then rebuild and run all again.
Then I'm going to Channel Editor -> Edit Page -> Add Component. The drag n drop component on page.
I did all changes by clicking on component. But anyway I don't see any changes on published page.
I didn't find any documentation about that, but maybe somebody resolve this issue and can help to me!
Thanks
I tried it out as well. It indeed does not work out of the box as you would expect. The component uses a template specific of the Setup feature, the seo.ftl. This makes it work as a draggable component in the channel manager. What it does not do is add the configured data to the html head.
If you check the seohelper.ftl [1] of the forge plugin, there you see the code that does this job. What you can do to make it work in your project is add the headcontribution tags as in [1] to seo.ftl. Also make sure you have a <#hst.headcontributions/> tag in the html head section of the base-layout.ftl of your project.
I will create a jira issue for this so.
[1] http://forge.onehippo.org/gf/project/hst-seo-support/scmsvn/?action=browse&path=%2Fcheckout%2Fhst-seo-support%2Fbranches%2Fhst-seo-support-1.01.xx%2Fsrc%2Fmain%2Fjava%2Forg%2Fonehippo%2Fforge%2Fseo%2Fsupport%2Fseohelper.ftl&revision=157