Skip to Content
Menu
This question has been flagged
1 Reply
7179 Views

Hello all,

I'm searching the right xpath expr selector to change the content attribute of each of those Facebook open graph tag in the < head> section of my main template.

Someone could help?

Thanks

<template id="website_lapagept.facebook_open_graph_description_iv" inherit_id="website_lapagept.website_layout_iv" name="Facebook open graph description - IV">

        <xpath expr='//head/meta[@property="og:title"]' position="attributes">

                <attribute name="content">Intime et vilain</attribute>

        </xpath>

</template>


<?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('_', '-')">

<head>

        <meta charset="utf-8" />

        <meta t-attf-property="og:title" t-attf-content="marde de" />

        <meta t-attf-property="og:type" t-attf-content="marde de" />

        <meta t-attf-property="og:image" t-attf-content="marde de" />

        <meta t-attf-property="og:site_name" t-attf-content="marde de" />

        <meta t-attf-property="og:description" t-attf-content="marde de christ" />


[......]


UPDATE : I tried those expressions with no luck :

    expr="//meta[@property="og:title"]/@content"

Avatar
Discard
Author Best Answer

Here is a solution that works!

<?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-call="website_lapagept.facebook_open_graph_description_iv">

</t>-->

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

<meta property="og:type" content="marde de " />

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

<meta property="og:site_name" content="marde de " />

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


AND


<template id="website_lapagept.facebook_open_graph_description_iv" inherit_id="website_lapagept.website_layout_iv" name="Facebook open graph description - IV">

<xpath expr='//meta[@property="og:title"]' position="attributes">

<attribute name="content">Intime et vilain</attribute>

</xpath>

</template>


Avatar
Discard
Related Posts Replies Views Activity
1
Sep 22
4517
2
Sep 22
10984
1
Mar 17
7184
1
Nov 15
4815
0
Jan 18
3197