Textpattern CMS support forum

You are not logged in. Register | Login | Help

#51 2018-07-13 07:41:03

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 750
Website

Re: etc_tree: trees for geeky grandmas

All I see (a very simple test for listing categories) is that the section put the value of attribute “section” in the url, as Oleg says. The help seems confusing, or in error.

Last edited by jpdupont (2018-07-13 07:41:55)

Offline

#52 2018-07-13 08:33:17

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

Re: etc_tree: trees for geeky grandmas

phiw13 wrote #313004:

According to the docs (and my experience, for the little that that counts…), it restrict the output to the named section(s).

The docs are confusing: section attribute does not restrict the category list itself, it only restricts the articles accessed via a category URL to the given section by appending ?s=section parameter. And it can not be a sections list.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#53 2018-07-13 12:14:56

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,579
Website

Re: etc_tree: trees for geeky grandmas

etc wrote #313012:

The docs are confusing: section attribute does not restrict the category list itself, it only restricts the articles accessed via a category URL to the given section by appending ?s=section parameter. And it can not be a sections list.

Now I’m even more confused :-/

(I rarely use category lists outside a section)

Offline

#54 2018-12-31 08:59:49

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 237

Re: etc_tree: trees for geeky grandmas

i tried a lot to make the following structure with etc_tree, but couldn’t !
+ if my sub-menu is open or main menu, active class should be applied
+ adding data-toggle, …
see bellow example I’m on Graphic Design page:

<ul class="nav navbar-nav">
    <li><a href="#">Home</a></li>
    <li class="dropdown active"><a href="#" data-toggle="dropdown" class="dropdown-toggle">Services</a>
        <ul class="dropdown-menu" role="menu">
            <li><a href="#">Web Design</a></li>
            <li class="active"><a href="#">Graphic Design</a></li>
            <li><a href="#">Video Design</a></li>
        </ul>
    </li>
    <li><a href="#">Contact</a></li>
</ul>

<txp:etc_query data='<txp:etc_tree id="0" />'
    replace="ul@@class=dropdown-menu;//li/ul/..@@class=dropdown"
/>

Offline

#55 2019-01-05 17:01:51

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

Re: etc_tree: trees for geeky grandmas

What do you mean by I’m on Graphic Design page? Is it a category, a section, something else? There is no indication of it in your tree.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#56 2019-01-12 11:00:45

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 237

Re: etc_tree: trees for geeky grandmas

Hi Thanks for your kind helps :-)
I just mentioned the structure of my current template, the menu structure is like that.
Graphic Design is an article or may be in the future that will be a category, any how for the moment I’ve problem by making that structure how to add attributes which is in my template like data-togle="dropdown" , role="menu" or assigning those classes to work nav submenus.

Offline

#57 2019-01-12 15:13:38

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

Re: etc_tree: trees for geeky grandmas

Ah, ok, I thought you need to add active class. Then your etc_query snippet should be ok, just prepend ul with // to match all <ul> blocks:

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

etc_[ query | search | pagination | date | tree | cache ]

Offline

Board footer

Powered by FluxBB