Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#145 2009-10-11 19:06:24

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

Adi,
may I request you for a new feature?
It would be really useful to have another option for list: list_class="Boolean"
It would let me style in the css a section link as current in the home page just using div#products ul.navbar li.menu_products but above all I can use more then a navbar in the home (like in the current project). For the moment I am using ids that, of course, don’t validate. I will show you the project hopefully in a few days.
Thanks again.

Offline

#146 2009-10-12 22:21:50

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

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

caruso_g wrote:

may I request you for a new feature?

Let me know when it’s ready & I’ll have a look.

Offline

#147 2009-10-21 14:49:52

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

Adi,
here it is if you want to take a look at it:
Texts From John

As you can see it is quite particular as a website, that’s why I needed such features.
I sadly solved just hardcoding it, but I still think those features could further expand the possibilities of your already great plugin.
Thanks for all of your help.

Offline

#148 2010-02-13 22:38:08

ttr
Member
Registered: 2006-10-26
Posts: 34

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

Hello Adi.
First I want to thank you for this great piece of code, which will save me a lot of time in the future.

After the installation of your plugin I discovered problems with displaying of sections. I got garbage instead of correct sectionnames (you must know they are all in russian).
So I decided to take a look over the source and fortunately I fixed it in 2 minutes.
The problem is in the adi_menu_htmlentities function. It makes use of PHP functions htmlspecialchars() and htmlentitties(). Both functions use ISO-8859-1 as default charset. My TXP-installation (and many others) uses UTF-8. All I had to do was to override the defaults.

function adi_menu_htmlentities($string) {
// escape supplied string using:
// 	htmlentities (ALL special characters translated)
//	or htmlspecialchars (only & " ' < > translated)
	global $escape;
	if ($escape == 'html') $string = htmlentities($string, ENT_COMPAT, 'UTF-8');
	if ($escape == 'htmlspecial') $string = htmlspecialchars($string, ENT_COMPAT,'UTF-8');
	return $string;
}

I think this would also fix the problem with accented chars, so your plugin doesn’t need the escape-attribute, you introduced with 0.9.1… and therefore the adi_menu_htmlentities function is obsolete. Just htmlentities with correct attribute for clean code. :) Textpattern uses UTF-8 as default, so there is no need for a charset-detection I think.

I hope my post was helpful. Cheers.

Last edited by ttr (2010-02-13 22:39:05)

Offline

#149 2010-02-13 23:43:35

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

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

ttr wrote:

I hope my post was helpful. Cheers.

Hi Paul. Yes your post was very helpful, thanks. Much obliged.

Adi

Offline

#150 2010-02-17 21:42:03

ttr
Member
Registered: 2006-10-26
Posts: 34

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

Hi Adi.
I’m playing with your plugin for hours now and little by little I go insane.
Is it possible to render a menu with top-level sections and children only of a current section somehow?

Let’s say I have three sections:
  • A
  • B
  • C
    and if I click on B it should be rendered as:
  • A
  • B
  • B1
  • B2
  • B3
  • C

Offline

#151 2010-02-17 22:53:21

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

I had the same need.
It would be great have an option to provide a list of only sections where one wants to display children.

Offline

#152 2010-02-18 09:08:29

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

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

ttr wrote:

Is it possible to render a menu with top-level sections and children only of a current section somehow?

The short answer is no. The long answer is: how about using CSS to suppress the children of the non-active sections?

Offline

#153 2010-02-18 10:03:00

ttr
Member
Registered: 2006-10-26
Posts: 34

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

Thanks for your quick answer. :)
Hiding via CSS is not neat nor tidy.
I think I’ll go the thorny way and try to modify your plugin to fit my needs. In case of success I’ll post my code-snippets next week here.

Offline

#154 2010-02-18 10:52:43

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

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

ttr wrote:

Hiding via CSS is not neat nor tidy.

Not sure if I agree but …

I think I’ll go the thorny way and try to modify your plugin to fit my needs.

No need, try 0.12beta and use a new attribute current_children_only="1"

Offline

#155 2010-02-18 21:48:40

ttr
Member
Registered: 2006-10-26
Posts: 34

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

Awesome, Adi! Thank you.
Any chances to include children articles too? In 0.11 I had the possibility to display them in combination with stm_article_order plugin.
I used this little, powerful snippet:
<txp:adi_menu current_children_only="1" article_attr='sort="position asc" sort="adi_menu_sort" />

Offline

#156 2010-02-19 00:24:36

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

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

ttr wrote:

Any chances to include children articles too?

Not sure if I understand. Do you want the non-current section articles suppressed?

Also, should your snippet have been:

<txp:adi_menu current_children_only="1" articles="1" article_attr='sort="position asc"' sort="adi_menu_sort" />

with articles="1" and a trailing single quote on the article_attr value?

Offline

Board footer

Powered by FluxBB