Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#196 2011-08-23 02:39:31
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Section-specific article sorting is available for play in beta version 1.2. The article_sort attribute has been enhanced:
article_sort="section1:title"- default sort “Posted desc”, articles in section1 sorted by “title”article_sort="title;section2:posted desc"- default sort “title”, articles in section2 sorted by “Posted desc”article_sort=";section1:posted desc;section2:custom_5"- default sort is database order, articles in section1 sorted by “Posted desc” & section2 articles sorted by custom field
I anyone wants to give it a go, please let me know how you get on.
Offline
#197 2011-09-20 12:57:12
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Hi Adi,
thanks for above. I have solved the problem by avoiding it alltogether. ;-) No solution though, but also no problem anymore. too
However, I have another riddle to solve and I am really scratching my head on this.
I need to find out the current menu level of the currently shown article.
I want to do this:
If I am on the second level show:
<txp:adi_menu sub_menu_level=‘2’ include_children=‘0’ />
When I am on 3rd level show:
<txp:adi_menu sub_menu_level=‘3’ include_children=‘0’ />
Where can I extract the current level?
I have put above txp in a form, which is called on every article. I am still on adi_menu 0.12 because I have made some changes.
Greetings and thanks again for the good work you do
Markus
Offline
#198 2011-09-22 21:58:34
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
mark.now wrote:
I need to find out the current menu level of the currently shown article.
Wouldn’t he presence of the menu markup indicate the level? I’m not sure why you’d need to know?
For example, <txp:adi_menu sub_menu_level="2" include_children="0" /> will only generate output if there is a second level section configured for the current section context.
Offline
#199 2011-09-23 16:44:24
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Thanks, after some more scratching of my had I have figured out that I had a thinking loop and came to the same solution you have told me. Thanks. Sometimes I figure, I think around too many corners.
Greetings Markus
Offline
#200 2011-12-12 01:55:01
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Hey Adi,
All my articles that have an ampersand in the title are being output with the character entity (i.e. &).
An article title Board Members & Staff becomes Board Members & Staff.
Any quick fix for this?
Offline
#201 2011-12-12 02:01:22
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
renobird wrote:
All my articles that have an ampersand in the title are being output with the character entity (i.e. &).
Hi Tom. This was a problem in the old days with section titles but should’ve been fixed. What version are you using? I’ll need do some investigation.
Offline
#202 2011-12-12 02:04:22
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Hi Adi,
I’m using 1.1
Section titles with ampersands appear to be working fine — just article titles.
Thanks for checking into it.
:)
Offline
#203 2011-12-12 02:47:21
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
As a quick fix – could you use Rah Replace to wrap round the title tag?
Offline
#204 2011-12-12 02:52:45
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Thanks tye, good call.
—
T
Offline
#205 2011-12-12 03:40:45
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
renobird wrote:
All my articles that have an ampersand in the title are being output with the character entity (i.e. &).
It seems that ampersands are escaped in article titles but not in section titles. adi_menu is escaping the already escaped. I’m a bit surprised that this hasn’t come up before! Anyway, could you try a quick adi_menu modification for me?
Find this line:
$article_list[$this_section][$new_index]['title'] = $a['Title'];
and change it to:
$article_list[$this_section][$new_index]['title'] = html_entity_decode($a['Title']);
Cheers,
Adi
Offline
#206 2011-12-12 03:45:39
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Bingo!
That fixed it. Thanks Adi.
I’m using your plugin on a few other sites and — as chance would have it — none of them have ampersands in the article titles.
This particular site has several.
:)
Offline
#207 2012-02-03 17:33:48
- Tony
- New Member
- From: Moscow
- Registered: 2012-02-03
- Posts: 4
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Is it possible for redirecting section links to behave as plain section links in terms of active_class? As of now, clicking the redirecting section link (and thus making it “active”) does not cause it to have the active_class applied.
Thanks for any assistance.
Offline
#208 2012-02-03 22:43:17
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Tony wrote:
Is it possible for redirecting section links to behave as plain section links in terms of active_class?
Hi Tony, I’ll look into it. Just out of curiosity, what’s the scenario – is it just a case of making the menu consistent? Thinking about it, I wonder if it should be the default behaviour.
Offline
#209 2012-02-04 15:07:22
- Tony
- New Member
- From: Moscow
- Registered: 2012-02-03
- Posts: 4
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Thank you for your feedback, gomedia.
The scenario is perhaps rather stupid, but I don’t guess a workaround other than using a redirect link.
I have a three-level hierarchy (menu + top submenu + bottom submenu) as shown in the simple example below.
> Services
—> Supply
————> Bread supply
————> Butter supply
The bottom submenu is article-based, which fits just fine. Section “Supply” corresponds to the menu item “Supply”, and adi_menu automatically forms the bottom submenu from articles put into the “Supply” section, which are “Bread supply” article, “Butters supply” article, and so on. Very well.
The issue is with the top submenu. “Supply” has “Services” as a parent. On clicking “Supply” I want to output a specific article (describing supply as a whole), which should be an article put in the “Services” section. But if I create this article and put it in the “Services” section, the “Supply” item would be duplicated in the submenu – one “Supply” item as an article belonging to the “Services” section, another “Supply” item as an item having “Services” as parent. To avoid this duplication, I specify “Supply” menu item to redirect to the URL of the “Supply” article.
So now I just want to highlight the “Supply” item when it’s been hit, that is, to apply active_class to it.
Offline
#210 2012-02-05 00:14:55
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_menu – section hierarchy, section menu and breadcrumb trail
Tony wrote:
The scenario is perhaps rather stupid, but I don’t guess a workaround other than using a redirect link.
Maybe there’s another way … if I’ve understood your requirements.
Could the Supply article (describing supply as a whole) be a Sticky article belonging the Supply section?
So when you click on Supply, you end up at the Supply section general page which displays the Sticky article only. And when you click Bread Supply, you still go to the Supply section but instead display an individual Live article.
Offline