Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2018-07-12 16:04:20

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: etc_tree: trees for geeky grandmas

Thanks Oleg ! Works fine !

I try now to pass the section as param of the form :

<txp::catlist wraptag="ul" lasection="spectacles" />

and

<txp:category_list children="-1" exclude parent wraptag="" break="">
    <txp:evaluate test="article_custom, output_form" wraptag="li">
        <txp:category />
        <txp:article_custom section='<txp:yield name="lasection" default="" />' category match="Category1" wraptag="ol" break="li">
            <txp:permlink><txp:title/></txp:permlink>
        </txp:article_custom>
        <txp::catlist wraptag="ul" />
    </txp:evaluate>
</txp:category_list>

But my code don’t work Now work !

Edit : The yield name don’t like laSection —> Must be lasection

With this modif, works fine ! Thanks again Oleg :-)

Last edited by jpdupont (2018-07-12 16:56:05)

Offline

#50 2018-07-12 23:46:28

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,208
Website

Re: etc_tree: trees for geeky grandmas

jpdupont wrote #312991:

Hi Yannis,

I just tested on my page, and I do not have the expected result. I feel that I do not understand the “section” attribute of category_list. —> Does it only display categories related to the section shown?

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

<txp:category_list section="apple, orange, pineapple" />

would only display articles in the sections named. That is not context sensitive.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

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

jpdupont
Member
Registered: 2004-10-01
Posts: 752

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: 5,211
Website GitHub

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.

Offline

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

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,208
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)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

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

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

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: 5,211
Website GitHub

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.

Offline

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

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

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: 5,211
Website GitHub

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"
/>

Offline

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

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

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: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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
Member
From: Kabul, Afghanistan
Registered: 2017-09-16
Posts: 49

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