Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#253 2013-01-25 23:08:26
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
PascalL wrote:
I think that would be great to be able to output a comma separated list, we could then use some partial sections lists filtered by parents inside other txp tags. That would allow the plugin not only to display, but also actually use the structure of the menus.
Maybe one for the “possibly in the future” list – the adi_menu code is a bit of a monster as it is!
Here’s a wild idea: feed the output of adi_menu into etz_striptags & then, if you want a comma separated list, put adi_join to work on it. Totally untested & probably highly dangerous.
Offline
#254 2013-01-25 23:47:13
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Thanks Adi ! Neat idea !
I didn’t know etz_striptags, that one could be very handy on some occasions. Wait… no.., no more available on the authors site. Nevermind.
Thanks anyway, you’ve put me on a track for some possible solution. I remember some search/replace plugins that could do the trick.
Pascal
Offline
#255 2013-01-26 08:15:00
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
PascalL wrote:
.., no more available on the authors site. Nevermind.
I’ll email you a copy.
Offline
#256 2013-01-26 09:09:26
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Are you on php 5.3.10 or newer? Then
<txp:etc_query data='<txp:adi_menu wraptag="" include_current="1" include_children="0" />' query="//li/text()" break="," />
should do just fine.
Edit: or, probably, query="//li/a/text()"
if section names are wrapped in links.
Last edited by etc (2013-01-26 09:27:31)
Offline
#257 2013-01-26 12:20:22
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Thanks a lot to both !
Last edited by PascalL (2013-01-26 12:22:46)
Offline
#258 2013-09-19 12:44:57
- debeo
- Member
- Registered: 2012-09-24
- Posts: 16
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Is there a way to output section names instead of titles? I’m need someting like this…
<txp:section_list sections='<txp:etc_query data=''<txp:adi_menu wraptag="" sections="section" include_default="0" include_parent="0" include_children="0" active_ancestors="0" sub_menu_level="1" />'' query="//li/a/text()" break="," />' />
..but as i get titles it won’t wok. This would enable me to build whole structure throughout the site.
Offline
#259 2013-09-19 13:42:37
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
section_list has a form attribute which lets you use the section tag with its title attribute. Although I won’t put all my money on it: It seems worth the try.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#260 2013-09-19 13:56:36
- debeo
- Member
- Registered: 2012-09-24
- Posts: 16
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Thanks for suggestion Uli, although I’ll have to think hard how to utilize here section tag with its title attribute:)
Offline
#261 2013-09-19 14:15:28
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
debeo wrote:
Is there a way to output section names instead of titles?
I wouldn’t complicate and do a straight db query:
<txp:etc_query data="SELECT name FROM txp_section WHERE adi_menu_parent='section'" break="," />
Offline
#262 2013-09-19 14:26:31
- debeo
- Member
- Registered: 2012-09-24
- Posts: 16
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Is there anything you can’t do with ‘etc_query’ ? :) Don’t know how for sure, but it works like a swiss watch!
Thanks a million Oleg!
Offline
#263 2013-09-19 14:26:35
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
debeo wrote:
I’m need someting like this…
<txp:section_list sections='<txp:etc_query data=''<txp:adi_menu wraptag="" sections="section" include_default="0" include_parent="0" include_children="0" active_ancestors="0" sub_menu_level="1" />'' query="//li/a/text()" break="," />' />
Not really sure what you’re trying to achieve here but using adi_menu to generate a <ul>/<li> structure, then stripping out the HTML tags to feed into txp:section_list to produce <ul>/<li> again seems a bit odd. Would it help to rewind a bit & tell us what the desired end result should be? There may be a simpler solution!
Offline
#264 2013-09-19 14:34:17
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
debeo wrote:
Thanks a million Oleg!
You are welcome! Now pray for Adi not to change adi_menu
db structure in some future version. :)
Offline