Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

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

#211 2012-02-06 19:37:40

Tony
New Member
From: Moscow
Registered: 2012-02-03
Posts: 4

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

This way the “Supply” item will also appear in the “Supply” submenu along with “Bread supply” and “Butter supply”, which is not the desired behaviour.

Offline

#212 2012-02-06 22:07:30

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

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

Tony wrote:

This way the “Supply” item will also appear in the “Supply” submenu along with “Bread supply” and “Butter supply”, which is not the desired behaviour.

Not if you restrict the menu to contain “live” articles only, using article_attr='status="live"'.

And then on the Supply page, you could do something like:

<txp:if_article_list>

	<txp:article status="sticky">
		<txp:title />
	</txp:article>

<txp:else />

	<txp:article>
		<txp:title />
	</txp:article>

</txp:if_article_list>

Give me a shout on email (via my website) if I’m still wide of the mark.

Offline

#213 2012-02-06 23:55:04

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

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

Version 1.2 available for download

  • section-specific article sort (for bg)
  • enhancement: adi_menu admin sections link to TXP section tab
  • fix: ampersands in article titles (thanks renobird)
  • fix: admin styling for Hive
  • now uses lifecycle events for install/uninstall, so TXP 4.2.0+ is now required

Offline

#214 2012-02-07 20:08:22

Tony
New Member
From: Moscow
Registered: 2012-02-03
Posts: 4

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

gomedia wrote:

Not if you restrict the menu…

Wow, this way I got the logic working! Many thanks, gomedia. This is rather a sophisticated solution, not on the surface. That I would not guess.

Offline

#215 2012-02-17 22:36:32

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

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

Hi there, I’m having an issue in that I can’t get the default section to recognize the sort order. It keeps coming up first on the list. Is this by design? How can I get around that?


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#216 2012-02-17 23:05:45

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

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

frickinmuck wrote:

Hi there, I’m having an issue in that I can’t get the default section to recognize the sort order. It keeps coming up first on the list. Is this by design? How can I get around that?

Try using default_first="0" – it’s on by default.

Offline

Board footer

Powered by FluxBB