Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

How to implement facebook open graph on my product page?

Naroči se

Get notified when there's activity on this post

This question has been flagged
graphimplementationopenfacebook
2 Odgovori
13645 Prikazi
Avatar
Pascal Tremblay

Hello all,

I'm searching the right way to implement Facebook open graph meta tag on the product page of my shop on the front-end. 

Somebody has successfully done it?

Would you have some tips?

Thanks


UPDATE #1

For example, I would search an example on how to fill dynamically those <meta> in a page like this product page : http://intimeetvilain.com/shop_iv/product/advanced-waterproof-jack-rabbit-1850

    <template id="website_lapagept.facebook_open_graph_tags_iv">

        <meta property="og:title" content="" />

        <meta property="og:description" content="" />

        <meta property="og:url" content="" />

        <meta property="og:image" content="" />

    </template>


UPDATE #2

When I inspect the source code on this page you are reading, I see that all the open graph <meta> are well filled. Where could I find the code to do the same thing on my odoo?


UPDATE #3

When we click on the « share » button just below, four buttons appear. How could I implement those 4 buttons myself on my odoo? Where is the code?

1
Avatar
Opusti
Emipro Technologies Pvt. Ltd.

What do you mean by Facebook Open Graph ? Is it means that you want to add a button of Facebook to share that product page into Facebook ? In this link (https://www.odoo.com/blog/odoo-news-5/post/top-apps-themes-in-odoo-store-314) there is 4 buttons ....Please confirm that do you want exactly like that ?

Avatar
Pascal Tremblay
Avtor Best Answer

Here is our answer. We have found it in the Odoo 9 code. It is surely not the best code, but it works for our needs at this moment. Thanks

<?xml version="1.0" encoding="utf-8"?>

        <openerp>

                <data>

                        <template id="website_lapagept.website_layout_iv" name="Main layout - IV">&lt;!DOCTYPE html&gt;

                                <html t-att-lang="lang and lang.replace('_', '-')"

                                        t-att-data-website-id="website.id if editable and website else None"

                                        t-att-data-editable="'1' if editable else None"

                                        t-att-data-translatable="'1' if translatable else None"

                                        t-att-data-view-xmlid="xmlid if editable else None"

                                        t-att-data-main-object="repr(main_object) if editable else None"

                                        t-att-data-oe-company-name="res_company.name">

                            <head>

                                    <meta charset="utf-8" />

                                    <t t-if="main_object and 'website_meta_title' in main_object and not title">

                                            <t t-set="title" t-value="main_object.website_meta_title"/>

                                    </t>

                                    <t t-if="main_object and 'name' in main_object and not title and not additional_title">

                                            <t t-set="additional_title" t-value="main_object.name"/>

                                    </t>

                                    <t t-if="not title">

                                            <t t-set="title"><t t-if="additional_title"><t t-raw="additional_title"/> | </t><t t-esc="(website or res_company).name"/></t>

                                    </t>

                                    <meta name="viewport" content="initial-scale=1"/>

                                    <meta name="description" t-att-content="main_object and 'website_meta_description' in main_object

and main_object.website_meta_description or website_meta_description"/>

                                    <meta name="keywords" t-att-content="main_object and 'website_meta_keywords' in main_object

and main_object.website_meta_keywords or website_meta_keywords"/>

                                    <meta name="generator" content="Odoo"/>

                        <!-- OpenGraph tags for Facebook sharing -->

                        <meta property="og:title" t-att-content="additional_title" />

                        <meta property="og:site_name" t-att-content="res_company.name" />

                        <meta property='og:url' t-att-content="request.httprequest.url_root+request.httprequest.path[1:end]"/>

                        <!-- OpenGraph pour le forum -->

                        <t t-if="main_object and 'plain_content' in main_object and main_object.plain_content">

                                <t t-set="og_description" t-value="main_object.plain_content[0:500]"/>

                                <meta property="og:description" t-att-content="og_description" />

                                <meta property='og:image' t-att-content="request.httprequest.url_root+'logo.png'"/>

                        </t>

                        <!-- OpenGraph pour les produits avec une description de vente -->

                        <t t-if="main_object and 'description_sale' in main_object and main_object.description_sale">

                                <t t-set="og_description_sale" t-value="main_object.description_sale"/>

                                <meta property="og:description" t-att-content="og_description_sale" />

                        </t>

                        <!-- OpenGraph pour les produits sans description de vente mais une description -->

                        <t t-if="main_object and not 'description_sale' and 'description' in main_object and main_object.description and not main_object.description_sale">

                                 <t t-set="og_description" t-value="main_object.description"/>

                                 <meta property="og:description" t-att-content="og_description" />

                        </t>

                        <!-- OpenGraph pour les images de produits -->

                        <t t-if="main_object and 'image' in main_object">

                                <meta property='og:image' t-att-content="request.httprequest.host_url+website.image_url(product, 'image_big', None if product_image_big else '300x300')" />

                        </t>

2
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
How to fill dynamically those open graph meta tag? Solved
graph open facebook
Avatar
1
sep. 22
6166
How to add Facebook Open Graph Tag in the <head> section? Solved
graph open facebook markup
Avatar
Avatar
1
mar. 17
8960
What is the xpath selector to get facebook open graph tag in my <head> section? Solved
graph xpath open facebook
Avatar
1
sep. 15
8861
How to fill correctly my « og:image » tag in my product page with « suggested products »? Solved
graph products open facebook suggested
Avatar
1
nov. 15
6279
In Odoo 10 og:image for facebook is not working correctly and loading image from last product of suggested product.
image graph facebook
Avatar
0
jan. 18
4627
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now