Textpattern CMS support forum

You are not logged in. Register | Login | Help

#71 2019-10-16 08:24:30

etc
Developer
Registered: 2010-11-11
Posts: 3,401
Website

Re: etc_tree: trees for geeky grandmas

ibadullah wrote #319729:

i have problem in etc_query, i have assigned the classes for the menu and the menu is working fine but the problem is that the nested list act as drop-down on the public side is not working. only its drop-down is not working. please have look to etc_query you will understand.

Ah, ok, sorry for confusion. Could you post here <txp:etc_tree id="6" /> output before passing it to etc_query? Starting with

<txp:variable name="tree"><ul>
<li><a href="#" title="">home</a><i class="ion-chevron-down"></i>
	<ul>
		<li><a href="#" title="" data-ripple="">home 1</a></li>
		<li><a href="#" title="" data-ripple="">home featured banner</a></li>
		<li><a href="#" title="" data-ripple="">home featured carousel</a></li>
		<li><a href="#" title="" data-ripple="">home with sidebar</a></li>
		<li><a href="#" title="" data-ripple="">home featured text carousel</a></li>
		<li><a href="#" title="" data-ripple="">home featured video </a></li>
		<li><a href="#" title="" data-ripple="">home boxed <strong>new</strong></a></li>
	</ul>
</li>
</ul></txp:variable>

and applying

<txp:etc_query debug="o"
    data='<txp:variable name="tree" />'
    replace="//ul@@class;
        //ul/li/ul/..@@class=submenu;
        //ul/li/ul/li/..@@class=menu-item-has-children;
        //ul/preceding-sibling::a@@data-toggle=dropdown@class=dropdown-toggle"
/>

I get as expected

<ul>
<li class="submenu"><a href="#" title="" data-toggle="dropdown" class="dropdown-toggle">home</a><i class="ion-chevron-down"></i>
	<ul class="menu-item-has-children">
		<li><a href="#" title="" data-ripple="">home 1</a></li>
		<li><a href="#" title="" data-ripple="">home featured banner</a></li>
		<li><a href="#" title="" data-ripple="">home featured carousel</a></li>
		<li><a href="#" title="" data-ripple="">home with sidebar</a></li>
		<li><a href="#" title="" data-ripple="">home featured text carousel</a></li>
		<li><a href="#" title="" data-ripple="">home featured video </a></li>
		<li><a href="#" title="" data-ripple="">home boxed <strong>new</strong></a></li>
	</ul>
</li>
</ul>

Offline

Board footer

Powered by FluxBB