user3718532
user3718532

Reputation: 21

Replace Menu in website using Xpath

I want to use Xpath to replace my website menu of odoo 8.

I don't want to replace all the header, but only one element in the menu : The shop

When i inspect the element li , i see this :

<span data-oe-model="website.menu" data-oe-id="5" data-oe-field="name" data-oe-type="char" data-oe-expression="submenu.name" data-oe-translate="1">Shop</span>

I want to replace this element by creating a mega menu only for "shop".

I don't know how to use Xpath for this case.

Any solution ? Thank's

Upvotes: 2

Views: 238

Answers (1)

MohitGhodasara
MohitGhodasara

Reputation: 2742

<template id="any_new_id" inherit_id="module_name.id_of_template">
    <xpath expr="//span" position="replace">
      your mega menu code
    </xpath>
 </template>

if you have any unique identifier then you can use it like this expr="//span[@id='span_id']" otherwise it replace all span tags

Upvotes: 0

Related Questions