Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2016-07-05 07:24:45

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: etc_tree: trees for geeky grandmas

Isn’t it the same post size problem? Can you still modify an existing node?

Offline

#26 2016-07-11 08:44:07

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

Re: etc_tree: trees for geeky grandmas

No that’s not the issue of post size problem, because i changed everything to high size, here is the response when i checked the network console:

<script type="text/javascript">
window.alert("Internal error \"Field \'lft\' doesn\'t have a default value\".\n")
</script>
I’m sorry. I’m afraid I can’t do that; <code>etc_tree</code> <code>save</code> is an unsafe operation
.

Offline

#27 2016-07-11 09:52:47

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: etc_tree: trees for geeky grandmas

Thanks for the report, sorry for the trouble. If it worked before, I guess your db settings have been changed recently (strict mode, maybe). Try to edit `etc_tree` table structure, setting default values of `lft` and `rgt` columns to 0. If it works, I will update the plugin.

Offline

#28 2016-07-11 10:42:40

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

Re: etc_tree: trees for geeky grandmas

i uninstalled etc_tree plugin and reinstalled again, but didn’t solve the problem, then i changed the field structure lft and rgt Default from None to NULL then it works fine.

Offline

#29 2016-07-28 06:29:23

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

Re: etc_tree: trees for geeky grandmas

right now active class apply just for URLs that ends with ‘/’ (slash) e.g http://localhost/category/news/
but it will not apply active class to the URLs without ending ‘/’ (slash) e.g http://localhost/?c=news

i use the following code:

<txp:etc_query
  data='<txp:etc_tree id="1" />'
  replace='//a[@href="<txp:etc_url />"]@@class=active'
/>

Offline

#30 2016-07-28 21:25:17

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: etc_tree: trees for geeky grandmas

You can try the following:

<txp:etc_query
  data='<txp:etc_tree id="1" breakclass=",activeli" />'
  replace='//li[@class="activeli"]/a@@class=active'
/>

Offline

#31 2016-08-07 12:18:34

bashirnoori
Member
From: Afghanistan
Registered: 2012-10-02
Posts: 64

Re: etc_tree: trees for geeky grandmas

I have another php page for my gallery management (gallery.php)
Now i want to bring this etc_tree menus which i use to txp section to my gallery.php file
is there any solution way to make link txp with my gallery.php file ?

Offline

#32 2016-09-07 09:22:08

bashirnoori
Member
From: Afghanistan
Registered: 2012-10-02
Posts: 64

Re: etc_tree: trees for geeky grandmas

I have a news website, having menus: Home, News, Politics, About, Contact
Is it possible when I visit any article of a category, active class should assign for that category ?
example: if I visit an article that belong to News category, so active class should assign for News menu.

Offline

#33 2016-09-07 11:06:33

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: etc_tree: trees for geeky grandmas

If your “categories” are Textpattern categories (one level), you don’t need etc_tree here. Something like this should work:

<txp:category_list categories="home, news, politics, about, contact" wraptag="ul" break="">
	<li<txp:if_article_category name='<txp:category />'> class="active"</txp:if_article_category>>
		<txp:category title="1" />
		<txp:article_custom category='<txp:category />' wraptag="ul" break="li">
			<txp:title />
		</txp:article_custom>
	</li>
</txp:category_list>

Last edited by etc (2016-09-07 11:08:30)

Offline

#34 2016-09-25 05:53:48

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

Re: etc_tree: trees for geeky grandmas

i want to have a duplicate menu links on my website that should list on the dropdown menu list, so
how to to list the menus as the following format:


<option value="http://sitename.com">Home</option> 
<option value="http://sitename.com/about">About</option> 
<option value="http://sitename.com/contact">Contact</option>
...

Offline

#35 2016-09-25 12:34:18

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: etc_tree: trees for geeky grandmas

raminrahimi wrote #301730:

i want to have a duplicate menu links on my website that should list on the dropdown menu list

If you need to duplicate an existing ul/li/a tree as select/option box, the most straightforward way will be to pass it through etc_query:

<txp:etc_query data='<txp:etc_tree id="1" />' query="ul/li/a" wraptag="select">
	<option value="{@href?}">{?}</option>
</txp:etc_query>

But check if you can not do your menus just with section_list by any chance.

Offline

#36 2016-09-25 13:15:37

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: etc_tree: trees for geeky grandmas

etc wrote #301731:

But check if you can not do your menus just with section_list by any chance.

Maybe this would work

<txp:section_list wraptag="" break="">
<option value="/<txp:section />/"><txp:section title="1" /></option> 
</txp:section_list>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB