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: 752
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,145
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,643
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: 243

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,145
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: 243

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,145
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

#58 2019-05-03 14:24:26

ibadullah
New Member
From: Kabul, Afghanistan
Registered: 2017-09-16
Posts: 22

Re: etc_tree: trees for geeky grandmas

I’m using bootstrap4 navbar, I tried a lot to make dynamic with etc_tree, but didn’t success.
Anyone please help me.
Here is the structure of menu:

    <ul class="navbar-nav mr-auto w-100 justify-content-end">
      <!-- active menu -->
      <li class="nav-item active">
        <a class="nav-link" href="#">MenuName <span class="sr-only">(current)</span></a>
      </li>
      <!-- without submenu -->
      <li class="nav-item">
        <a class="nav-link" href="#">MenuName</a>
      </li>
      <!-- menu has submenu -->
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#"  data-toggle="dropdown">
          MenuName
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
          <a class="dropdown-item" href="#">SubMenu_Item</a>
          <div class="dropdown-item"></div>
          <a class="dropdown-item" href="#">SubMenu_Item</a>
          <div class="dropdown-item"></div>
          <a class="dropdown-item" href="#">SubMenu_Item</a>
          <div class="dropdown-item"></div>
        </div>
      </li>
    </ul>

Offline

#59 2019-05-04 07:38:41

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,188
Website

Re: etc_tree: trees for geeky grandmas

The navbar code from my Bootstrap 4 Textpattern repo could help, doesn’t need a plugin either.

Offline

#60 2019-05-04 10:43:34

ibadullah
New Member
From: Kabul, Afghanistan
Registered: 2017-09-16
Posts: 22

Re: etc_tree: trees for geeky grandmas

hi philwareham
our menu structure is from different section, category and article
etc_tree plugin is the best thing that we can create custom menus.

Offline

Board footer

Powered by FluxBB