Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2015-12-07 18:53:54
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: etc_tree: trees for geeky grandmas
I’ve more links on my etc_tree around 227 records, now i can’t add new links
when i add new link after clicking Save button, those new link will remove and nothing new append just available those old links.
I don’t know what’s the problem, may be the size of etc_form goes heavy and don’t allow anymore …
Offline
Re: etc_tree: trees for geeky grandmas
It’s probably related with maximum post size (or this), please try the proposed solutions.
Last edited by etc (2015-12-07 20:18:04)
Offline
#15 2015-12-08 17:37:36
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: etc_tree: trees for geeky grandmas
done ! now works fine thanks :-)
Offline
Re: etc_tree: trees for geeky grandmas
Glad you have solved it. It’s a temporary solution, I should think of packing the whole tree in one _POST
variable, but have no time atm.
Offline
#17 2016-05-26 06:47:44
- bashirnoori
- Member
- From: Afghanistan
- Registered: 2012-10-02
- Posts: 79
Re: etc_tree: trees for geeky grandmas
how to assign dynamic class for each list which has submenus, example:
<li><a href="...">Home</a></li>
<li class="hasmenu"><a href="...">News</a>
<ul class="submenu">
<li><a href="...">Local</a></li>
<li class="hasmenu2"><a href="...">Global</a>
<ul class="submenu2">
<li><a href="...">Sports</a></li>
<li><a href="...">Plitics</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="...">Contact</a></li>
Offline
Re: etc_tree: trees for geeky grandmas
Not sure it’s a good idea to use numbers in class names, but you can:
<txp:etc_query
data='<txp:etc_tree id="0" />'
replace="//ul@@class=submenu{##};//li[ul]@@class=hasmenu{##}"
/>
Edit: or this, if you want to assign numbers by levels:
<txp:etc_query
data='<txp:etc_tree id="0" />'
replace="//ul@@class=submenu{count(ancestor::ul)};//li[ul]@@class=hasmenu{count(ancestor::ul)}"
/>
Last edited by etc (2016-05-26 08:54:38)
Offline
#19 2016-05-27 13:10:35
- bashirnoori
- Member
- From: Afghanistan
- Registered: 2012-10-02
- Posts: 79
Re: etc_tree: trees for geeky grandmas
<txp:etc_query
data='<txp:etc_tree id="1" />'
replace='//a[@href="<txp:etc_url />"]@@class=active'
/>
Assigning active class to the current menu works fine,
but if we have nested menus that will assign just to that nested menu, not assign to the top level menu.
e.g. I need like this: if i’m in the Local
page active class should assign for Local & News menus.
<li><a href="...">Home</a></li>
<li><a href="...">About</a>
<li><a class="active" href="...">News</a>
<ul class="submenu">
<li><a class="active" href="...">Local</a></li>
<li><a href="...">Global</a></li>
</ul>
</li>
<li><a href="...">Contact</a></li>
Reason: if don’t assign active class to the top level menus, nested menus are hidden by default and no one know I’m in which page !
Offline
Re: etc_tree: trees for geeky grandmas
Does this help?
<txp:etc_query
data='<txp:etc_tree id="1" />'
replace='//a[@href="<txp:etc_url />"]@@class=active;
//a[@href="<txp:etc_url />"]/ancestor::ul/preceding-sibling::a[1]@@class=active'
/>
This assumes you always have <a />
link before <ul />
.
Offline
#21 2016-06-06 10:41:31
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: etc_tree: trees for geeky grandmas
i think there is a bug: when you create new List menu, you can’t drag/drop any submenus to inner of that until reloading the page or clicking save button.
Note: i’m using firefox 46.
Offline
#22 2016-06-19 06:53:27
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: etc_tree: trees for geeky grandmas
how i can assign a class and ID to first-child of <ul> that’s my main menu wrapper ?
my code is now:
<txp:etc_query
data='<txp:etc_tree wraptag="ul" break="li" id="12" />'
replace='//a[@href="<txp:etc_url />"]@@class=active'
/>
Offline
Re: etc_tree: trees for geeky grandmas
Looking at the plugin help, it looks like the etc_tree
tag has support for class="my-wrapper-class"
and breakclass="item-class"
attributes.
TXP Builders – finely-crafted code, design and txp
Offline
#24 2016-07-05 06:02:08
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: etc_tree: trees for geeky grandmas
Everything was fine, but today I’m going to add some new menus to etc_tree
after clicking save button, etc_tree menus goes hide and no changes apply
when i checked the Console -> Network , this error appear: I’m sorry. I’m afraid I can’t do that; etc_tree save is an unsafe operation.
Note: adding new menu not works, but if i remove any menu it will save fine !
Offline