Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#271 2014-07-17 14:16:33
- wavesource
- Member

- From: Australia
- Registered: 2011-08-02
- Posts: 56
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Howdy gomedia – nice job. Love your work. Installed and working great on a 4.5.4 TXP
And you got drag and drop ordering in there as well? Nice work.
Categories? I know we can direct to these by URL, but I’ve added a category, dropped an article into it, and can’t see how adi_menu is making that a little more accessible… But if that’s not intended, I think what you’ve got here is pretty fantastic.
Offline
#272 2014-07-17 17:48:58
- raminrahimi
- Member

- From: India
- Registered: 2013-03-19
- Posts: 278
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
i request some new things for adi_menu :
1. that should be possible to link (redirect) with an article, example if i need a page of “ABOUT US” 2. if i need two menus to my website, with this version i can’t ! it mean that should be possible to make more navigations. example i have one mainmenu at the top and one else at the left side.thanks
Last edited by raminrahimi (2014-07-17 17:50:52)
Offline
#273 2014-07-17 23:24:11
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
wavesource wrote #282230:
Howdy gomedia – nice job.
Thanks.
Categories? I know we can direct to these by URL, but I’ve added a category, dropped an article into it, and can’t see how adi_menu is making that a little more accessible
Just provides another option for menu items.
Offline
#274 2014-07-17 23:33:00
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
raminrahimi wrote #282245:
1. that should be possible to link (redirect) with an article, example if i need a page of “ABOUT US”
I take it “ABOUT US” is not in an “About” section? I normally set up sections for everything, & give them sticky articles.
There is an attribute articles="1" which switches on articles mode – but they’re listed under their sections.
I’ll have a think if it’s feasible to add a new redirect option to an article ID.
2. if i need two menus to my website, with this version i can’t ! it mean that should be possible to make more navigations. example i have one mainmenu at the top and one else at the left side.
Use the sub_menu attribute. So on a page you’d have:
<txp:adi_menu />
<txp:adi_menu sub_menu_level="2" />
The first tag gives you your main menu. The second is section-sensitive, and just gives you menu items under the current section.
Last edited by gomedia (2015-07-07 13:22:37)
Offline
#275 2014-07-18 00:51:27
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Hey Adi – I’ve installed on a new installation, although not complicated… I’ll use this plugin… thanks :)
Offline
#276 2015-04-16 02:11:34
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Adi
I have been using your fabbo plugin and it has worked a treat.
This is the code I am currently using.
<nav role="navigation">
<txp:adi_menu menu_id="" class="menu" active_class="current" current_children_only="1" parent_class="" articles="1" active_articles_only="1" article_attr='sort="title" status="live" ' sort="adi_menu_sort" article_position="before" />
</nav>
Now I want to have a new subsection, B3, that takes in various articles from other subsections, kinda a “Best Of” type scenario:
- A
- B
- B1
- B1a article
- B1b article
- B1c article
- B2
- B2a article
- B2b article
- B3
- B1b article
- B2a article
- B1
- C
So, in the sub-section B3 menu I want to be able to pull out a few existing articles that are actually from another section.
Reckon this is in any way possible? Somehow I was thinking categories might be useful in this instance.
cheers,
graeme
Offline
#277 2015-04-16 06:12:21
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
detail wrote #290016:
I have been using your fabbo plugin and it has worked a treat.
Nice to hear!
So, in the sub-section B3 menu I want to be able to pull out a few existing articles that are actually from another section.
Reckon this is in any way possible? Somehow I was thinking categories might be useful in this instance.
I think this is a deficiency that @wavesource was alluding to a little while ago. Currently it’s possible to add a menu item that’ll give you a link to a category page but no articles belonging to that category are listed in the actual menu.
I’ll look into it – but please give a couple of weeks, I’ve got the outlaws visiting at the moment …!
Offline
#278 2015-04-16 06:32:28
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Currently it’s possible to add a menu item that’ll give you a link to a category page but no articles belonging to that category are listed in the actual menu.
Yeah, I have the sub-section in the menu but no way to link the articles.
Essentially it is a “Best Of” type situation where I want to pick up quite a few articles from completely different sub-sections and have them listed in their own sub-section menu.
No stress about the timing here, I’m my own client on this one, plenty of other bits to keep me occupied.
Just totally enjoy the company of your in laws, and any recovery period that may be needed.
g
Offline
#279 2015-04-16 09:43:44
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
It’s easy to inject articles (and other stuff) inside the menu. Suppose that your B3 (empty) section is called featured, assign the featured articles some category (say, featured) and test this:
<txp:variable name="featured"><txp:article_custom wraptag="ul" break="li" category="featured" sort="title">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom></txp:variable>
<txp:etc_query data='<txp:adi_menu menu_id="" class="menu" active_class="current" current_children_only="1" parent_class="" articles="1" active_articles_only="1" article_attr=''sort="title" status="live" '' sort="adi_menu_sort" article_position="before" />'
replace='//a[@href="<txp:section name="featured" url="1" />"]$={?featured}' />
Offline
#280 2015-04-16 20:59:06
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Humm, that will be an elegant solution. Thanks for helping out, I haven’t used etc_query before. It can do amazing things.
Sadly at the moment it isn’t quite working. Nothing in the menu shows up when I modify your code with my category and section names.
<txp:variable name="te-araroa"><txp:article_custom wraptag="ul" break="li" category="te-araroa" sort="title">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom></txp:variable>
<txp:etc_query data='<txp:adi_menu menu_id=" " class="menu" active_class="current" current_children_only="1" parent_class=" " articles="1" active_articles_only="1" article_attr= ' 'sort="title" status="live" ' ' sort="adi_menu_sort" article_position="before" />'
replace='//a[@href="<txp:section name="huts-campsites-te-araroa" url="1" />"]$={?te-araroa}' />
I’ve done a few variations, taking out bits just to get something happening but ain’t any better.
Do you think it’s choking on this bit?
article_attr= ' 'sort="title" status="live" '
There’s a remarkable lot of ‘ and “ competing for attention.
Yes, I did install etc_query, and I can’t see any curly quote marks which is my usual issue . . .
cheers
g
Offline
#281 2015-04-17 07:30:16
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
detail wrote #290042:
Do you think it’s choking on this bit?
article_attr= ' 'sort="title" status="live" '...There’s a remarkable lot of ‘ and “ competing for attention.
Some text editors prettify beyond all recognition. :) There shouldn’t be a space before neither between two single quotes. To make it easier, you can store the menu in a variable and pass it to etc_query like this:
<txp:variable name="te-araroa"><txp:article_custom wraptag="ul" break="li" category="te-araroa" sort="title">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom></txp:variable>
<txp:variable name="menu">
<txp:adi_menu menu_id=" " class="menu" active_class="current" current_children_only="1" parent_class=" " articles="1" active_articles_only="1" article_attr= 'sort="title" status="live" ' sort="adi_menu_sort" article_position="before" />
</txp:variable>
<txp:etc_query data={?menu}
replace='//a[@href="<txp:section name="huts-campsites-te-araroa" url="1" />"]$={?te-araroa}' />
Pass debug="d" attribute to etc_query to see if the menu is well imported. If this does not help, check that
- txp is 4.0.7 or above
- php is 5.3.10 or above
Offline
#282 2015-04-17 08:17:28
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Sadly still an issue, the menu is not visible.
The basic menu is loading according to your debugger but without the etc_query changes.
So I checked the php and my host said 5.2, so I have changed it to 5.3. They don’t tell me what version of 5.3 it is.
There’s a 20 minute delay for the switchover apparently, and it’s 8pm on Friday night so I’m wondering what I’m doing still sitting at my computer interface.
In any case it’s porn o’clock so the whole internet has slowed down, too many people online, might as well take a break until tomorrow.
Thanks muchly for your help, it seems it might not be just my poor understanding of the coding after all.
Offline
#283 2015-04-17 08:21:06
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Yahoo!!!
No, it is looking just fine, well almost, but that is something that is in my hands.
Leave it to tomorrow.
Thanks again, just brilliant.
Offline
#284 2015-04-19 00:14:37
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Making some progress here.
The following code is working, producing the article list for the category “te-araroa” that I want, but it has a couple of issues.
<nav role="navigation">
<txp:variable name="te-araroa">
<txp:article_custom wraptag="ul" break="li" class="menu_article" category="te-araroa" limit="100" sort="title">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
</txp:variable>
<txp:variable name="menu1">
<txp:adi_menu menu_id="" class="menu" active_class="current" current_children_only="1" parent_class="" articles="1" active_articles_only="1" article_attr='sort="title" status="live" class="menu_article"' sort="adi_menu_sort" article_position="before" />
</txp:variable>
<txp:etc_query data={?menu1}
replace='//a[@href="<txp:section name="huts-campsites-te-araroa" url="1" />"]$={?te-araroa}' />
</nav>
1. I have created a few articles that are in the huts-campsites-te-araroa sub-section. These appear twice when the te-araroa menu is active: initially folded into the category te-araroa articles, then repeated as specific subsection articles.
2. The specific te-araroa articles are always shown. This does not happen if I’m using the pre-category fiddling adi_menu code, which is basically identical.
<txp:adi_menu menu_id=" " class="menu" active_class="current" current_children_only="1" parent_class=" " articles="1" active_articles_only="1" article_attr='sort="title" status="live" class="menu_article"' sort="adi_menu_sort" article_position="before" />
So the code at the top not only shows the specific te-araroa articles twice, they are always shown when other sub-sections are active.
Man, I am so close. I can get around some of this using if_section but I would prefer to make it more bullet proof than that.
Last edited by detail (2015-04-19 00:15:12)
Offline
#285 2015-05-05 08:19:26
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Sorry, this isn’t quite resolved, as yet.
I’ve got around the category items always being shown in all of the section menus with a conditional if_section.
<nav role="navigation">
<txp:if_section name="huts-campsites-te-araroa">
<txp:variable name="te-araroa">
<txp:article_custom wraptag="ul" break="li" class="menu_article" category="te-araroa" limit="100" sort="title">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
</txp:variable>
<txp:variable name="menu1">
<txp:adi_menu menu_id="" class="menu" active_class="current" current_children_only="1" parent_class="" articles="1" active_articles_only="1" article_attr='sort="title" status="live" class="menu_article"' sort="adi_menu_sort" article_position="before" />
</txp:variable>
<txp:etc_query data={?menu1}
replace='//a[@href="<txp:section name="huts-campsites-te-araroa" url="1" />"]$={?te-araroa}' />
<txp:else />
<txp:adi_menu menu_id="" class="menu" active_class="current" current_children_only="1" parent_class="" articles="1" active_articles_only="1" article_attr='sort="title" status="live" class="menu_article"' sort="adi_menu_sort" article_position="before" />
</txp:if_section>
</nav>
That means I don’t have the category list in the menu all the time, just when in the right sub-section. That’s good.
I still have this issue: When I’m in the sub-section “huts-campsites-te-araroa”, the category list from a number of different sections, that’s the “best of” articles, 68 of them in total, are shown are in the menu in perfect order. Fantastic.
The problem is that there are 30 of these 68 articles which have been specifically assigned to this sub-section, and are in a separate list that is at the end of the category list so they are effectively listed twice, the menu shows 68 + 30, instead of just the 68.
Is there some way that I can stop these articles from showing up in the menu?
Confused?
The article list page is here
The menu is on the right hand side. I still have a bit of tweeeeking with the colour scheme here to get the menu to read effectively but you should be able to see that some articles are being listed twice.
Last edited by detail (2015-05-05 08:23:14)
Offline