Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
7654 Näkymät

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
Hylkää
Tekijä Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
syysk. 22
4938
2
syysk. 22
11515
1
maalisk. 17
7646
1
marrask. 15
5162
0
tammik. 18
3417