Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#256 2013-01-26 09:09:26

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

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

PascalL
Member
From: Switzerland
Registered: 2009-03-09
Posts: 132
Website

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

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

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

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

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

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

#265 2013-09-19 14:34:28

debeo
Member
Registered: 2012-09-24
Posts: 16

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

gomedia wrote:

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!

I just need few different article rendering based on depth and type of sections. Oleg’s solution will serve me well and save me from numerous pages/templates within project.

Offline

#266 2014-07-16 09:43:14

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Time to get experimental!

Up until now, if you’ve wanted a menu item that is redirected somewhere else – the only way to achieve it with adi_menu has been to create a normal section. It has worked well but sometimes is not ideal, and having been given a nudge by wavesource, I’ve come up with an alternative.

In this beta version it’s possible to add virtual sections to the menu – i.e. sections that only have relevance in the adi_menu world and will not be seen anywhere else.

These virtual sections can be redirected to real sections, links or article categories (yes, categories is a new feature as well). Virtual sections can be woven into the menu hierarchy as children or parents, just like their real cousins.

… and one more thing, you can drag & drop to alter the order in which sections (real or otherwise) appear in the menu.

In summary, I’m after some brave souls to download the beta version and have a play with:

  • virtual sections
  • redirection to article categories
  • drag & drop ordering

If there’re any takers, I’d be very pleased to receive feedback.

Offline

#267 2014-07-16 09:51:58

debeo
Member
Registered: 2012-09-24
Posts: 16

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Yaaay! Thats a great news! I’ll give it a try soon. Categories and ordering are excellent addition, jut what I need for my next project.

One question though, will this thingy ‘output section names instead of titles’ from a posts above still work in this version?

Last edited by debeo (2014-07-16 09:52:21)

Offline

#268 2014-07-16 10:01:28

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

debeo wrote #282181:

One question though, will this thingy ‘output section names instead of titles’ from a posts above still work in this version?

Er, good question. The short answer is yes & no. The long answer is probably for real sections, but probably not for virtual sections – as they’re held in a different database table.

Remind me the reason for using names instead of titles? It’s probably a straightforward option to build in, maybe, possibly …

Offline

#269 2014-07-16 10:42:10

debeo
Member
Registered: 2012-09-24
Posts: 16

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

gomedia wrote #282182:

Remind me the reason for using names instead of titles? It’s probably a straightforward option to build in, maybe, possibly …

Hmm, to be honest I can’t remember the reason lol. I guess its when I need to show just a branch of adi_menu and eventually its subitems base on the section in which it resides. I had issues doing that with adi_menu alone just can’t remember the details why.

Anyway, many thanks for your efforts. New features are very useful.

Offline

#270 2014-07-16 13:30:36

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

debeo wrote #282183:

Hmm, to be honest I can’t remember the reason lol.

Let me know if you find yourself in a similar scenario, & I’ll help if I can.

Offline

Board footer

Powered by FluxBB