Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How to embed a specific script into an empty webpage created under Odoo?

By
michel Guénard
on 4/3/15, 8:04 AM 948 views

I need to paste the following code -provided by an external source -  into one of my web page.

Could someone explain to the "non-expert" I am, how to do this only with the V8 developper mode.

In particular, where shall I insert the above code in the HTML code of the page.

This is supposed to pull the content of a news source into my web site!

<script type="text/javascript">
var UWA = {hosts:{"uwa":"http://uwa.netvibes.com","exposition":"http://uwa.netvibes.com"}}, UWA_ASYNC = UWA_ASYNC || [];
    UWA_ASYNC.push({url: "http://uwa.netvibes.com/apps/multifeed.php?provider=feed&url=http%3A%2F%2Fbit.ly%2F1pFRTTo&title=Acualit%C3%A9s+musicales+et+musicologiques",options:{"title":""}});
(function () {
    var a = document.getElementsByTagName("script"), b = a[a.length - 1] || document.body.lastChild,
        c = b.parentNode, d = document.createElement("script"), e = document.createElement("div");
    e.id = "UWA_ASYNC"; d.type = "text/javascript"; d.async = true;
    d.src = ("https:" == document.location.protocol ? "https://" : "http://") + UWA.hosts.uwa.split("://")[1] + "/lib/c/UWA/js/UWA_Embedded.js?v=1.3.RC4";
    c.insertBefore(d, b); c.insertBefore(e, b)
})();
</script>
0
Dieter Huelskamp
On 4/10/15, 11:14 AM

I guess, that is  an issue with odoo, generally speaking there are two parts to put javascript first section would be within the head area and second one within the body area, each HTML-Document consists off. Anyhow, Odoo is missing a real HTML-Inline-Editor. Also, if you go to take using provided HTML-Editor, that let you modify several template files (including it pulls actual webpage content into one),  it seems to validate any inserted code agains some xml standard (probably strict xhtml). This is good for avoiding, that someone totally destructs webpage, by pasting any code. Anyhow would be great to have an overview, what kind of snippets are allowed and what not by system. 

what do you recommend as a solution? Is there any way to bypass the Odoo context and still have a page within the website where a javascript will be embeded?

AD LIBITOM, michel Guénard
on 4/10/15, 5:45 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 4/3/15, 8:04 AM
Seen: 948 times
Last updated: 4/10/15, 11:18 AM