Community mailing list archives


V9 - Website - menu item / xpath question

Arjan Duijs
- 29 يناير, 2016 06:45:49
Hi all,
I am trying to add a custom snippet to implement Yamm!3 megamenu.

In the V9 theme tutorial they show you how to add a custom menu item which is pretty straight forward.
<record id="services_page_link" model="">
        	<field name="name">Mi Servicios</field>
        	<field name="url">#</field>
        	<field name="parent_id" ref="website.main_menu" />
        	<field name="sequence" type="int">40</field>
to add a subitem to that newly create menu item, simply refer to that ones parent id.
<record id="sub_services_page_link" model="">
	        	<field name="name">Otro Servicios</field>
	        	<field name="url">#</field>
	        	<field name="parent_id" ref="services_page_link" />
	        	<field name="sequence" type="int">40</field>
so far it works.

However, i would like to give it some extra clases, and add custom html for the megamenu.

I have tried using a Template con Xpath, using:
<xpath expr="//ul[@id='top_menu']" position="insert">
<xpath expr="(//ul[@id='top_menu']/li)[2]" position="before">
Doesnt matter what i try, the button with the Megamenu always ends up on the right side (like it gets inserted first before all other buttons and therefor ends up on the right side)

The place where i would like to have it is 2nd, right after HOME.

Anyone got an idea on how to solve this?