Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2008-09-24 19:20:04

macTigers
Member
From: Bernkastel-Kues
Registered: 2008-08-13
Posts: 10

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

Thank you, adi!

Your plugin is great. I was just looking for something like that, and a navigation based on sections is a great idea. I would like to use it in present and future projects.

Would it be possible to add attributes to omit child sections (i.e. omit_children=“all”, omit_children=“inactive”)? This would enable me to have a splitted navigation. The (included) main navigation items would always show up in the main navigation. The sub navigation items in another navigation area would show up only, when the parent navigation item is active. It would work as in http://www.elch-lifestyle.de/index.php?s=Konzept. Presently i am using a mixture of section/category for navigation. Would be great if you could help me. I was trying to add this to your code, but I don’t want to mess it up! Maybe you got a better idea.

Thanks

Offline

#38 2008-09-24 23:36:28

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

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

macTigers wrote:

Would it be possible to add attributes to omit child sections?

Sounds like a good idea, I’ll look into it.

BTW, I looked at your website and the lovely lady is obscuring the navigation (at least on Mac Safari & Firefox) but I did glimpse some of what you are trying to achieve before her image appeared.

Offline

#39 2008-09-25 08:11:15

macTigers
Member
From: Bernkastel-Kues
Registered: 2008-08-13
Posts: 10

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

Thank you adi for your quick reply!

macTigers wrote:

the lovely lady is obscuring the navigation

She is not supposed to do that :) I checked it with Firefox >2 and 3, and Safari 3.1.2 as well as with the IE 6 and 7 both on Win Vista and it looked ok. Well, so much about W3C, browsers and design :)

In this case there are two horizontal navigation bars. For each of them I would use the adi_menu tag with different attributes. In the upper main navigation all selected sections would appear. In the horizontal sub navigation bar below the items appear only when the corresponding parent section is active. In this case the main navigation consists of sections and the sub navigation of categories. With your tool it could become much easier, since I could organize the whole content by sections only.

There could be another approach by telling your script which levels should be used like use_level=“all”, use_level=“1” (only parent sections), use_level=“2” … and the depth of the levels below like limit_level_depth=“1”.

I know, this is a lot of work and maybe you got better ideas. Yet, it would be worth some consideration. I am looking forward for your answers.

Offline

#40 2008-09-25 22:16:40

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

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

macTigers wrote:

In the upper main navigation all selected sections would appear. In the horizontal sub navigation bar below the items appear only when the corresponding parent section is active.

Couldn’t this be implemented using CSS? adi_menu was written with dropdown menus in mind. These are done by hiding all the sub-menus (i.e. sub-lists containing children) by default apart from the one under the top level section that’s being hovered over. In your scenario, you could hide (i.e. display:none;) all the sub-menus except the one that is below the currently active section.

There could be another approach by telling your script which levels should be used like use_level=“all”, use_level=“1” …

Possibly,but the “omit children” approach might be safer.

Offline

#41 2008-09-26 06:40:47

macTigers
Member
From: Bernkastel-Kues
Registered: 2008-08-13
Posts: 10

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

Yes, Adi. This is a possibility which I was thinking about too. I need to try this one first. There might be one problem only: if CSS is not supported by the browser , e.g. a screenreader, I would have a double navigation which could be kind of annoying for handicapped users. In this case the omit_children attribute would be a great help.

Thank you for your quick answer.

Offline

#42 2008-09-27 13:28:49

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

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

macTigers wrote:

There might be one problem only: if CSS is not supported by the browser , e.g. a screenreader …

Have a go with version 0.6 and use a new attribute include_children="0".

Offline

#43 2008-09-28 15:24:46

macTigers
Member
From: Bernkastel-Kues
Registered: 2008-08-13
Posts: 10

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

Have a go with version 0.6 and use a new attribute include_children="0".

Adi, you did a great job with the update to 0.6. I tried it on www.hotelsundco.de . It is just what I needed.

This did the job:

<txp:adi_menu exclude="Legalnavigation,Servicenavigation" include_children="0" sort="adi_menu_sort"/>

Legalnavigation and Servicenavigation are the parent sections for navigations which I can output on a separate area later.

Thanks a lot!

For the subnavigation below I had to use the following, to prevent the output of child sections of sections which are not active.

<txp:if_section name='HotelsundCo'> <txp:adi_menu sections="HotelsundCo" include_parent="0"/> </txp:if_section> <txp:if_section name='ELCH'> <txp:adi_menu sections="ELCH" include_parent="0"/> </txp:if_section>

This works of course, yet it might not be the best way, since I would have to change the forms any time I would add child sections to new parent sections which are not included in the form. Maybe you got another idea how to do that.

Anyway, thanks a lot for your quick respond and excellent job!

Last edited by macTigers (2008-09-28 15:27:04)

Offline

#44 2008-09-28 23:17:07

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

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

macTigers wrote:

Adi, you did a great job with the update to 0.6. I tried it on www.hotelsundco.de . It is just what I needed.

My pleasure. Glad it worked for you.

For the subnavigation below I had to use the following, to prevent the output of child sections of sections which are not active.

<txp:if_section name='HotelsundCo'> <txp:adi_menu sections="HotelsundCo" include_parent="0"/> </txp:if_section> <txp:if_section name='ELCH'> <txp:adi_menu sections="ELCH" include_parent="0"/> </txp:if_section>

TXP 4.0.7 will be fabulous in situations like this because you’d be able to do:

<txp:adi_menu sections="<txp:section />" include_parent="0" />

But in the meantime, try this version 0.6 with a new attribute include_current:

<txp:adi_menu include_current="1" include_parent="0" />

Offline

#45 2008-09-29 19:15:48

macTigers
Member
From: Bernkastel-Kues
Registered: 2008-08-13
Posts: 10

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

But in the meantime, try this version 0.6 with a new attribute include_current:

<txp:adi_menu include_current="1" include_parent="0" />

Hi again Adi. I tried it and it worked great. But then I realized, that it was not what I really intended. If I clicked on a child section’s link in my sub navigation, this section would become active, but the parent section inactive. Therefore all the other child sections would disappear. Of course, my solution was much more complicated but lead to the same – wrong result. So it was my error. The same would happen with the new Textpattern version. But I’d love the nested textpattern tags. Now I had to use an even more complicated attempt:

@
<!— HotelsundCo —>
<txp:if_section name=‘HotelsundCo,Team’> <txp:adi_menu exclude=“Vita-Lounge, 5-Elemente-Catering, Betthupferl, Powerpause, Powerecke, Corporate-Identity, Public-Relations, Werbung” include_parent=“0” />
</txp:if_section>


@

Of course this is ok at the moment since my project won’t have more than 50 sections at the end :) . Maybe it would help, if the attribute include_current would work not for the current section only, but also for the parent section of the active section. This in turn would be excluded from being shown, while all it’s children would still be visible. I hope you see what I mean. And I am still really thankful for your good job.

Last edited by macTigers (2008-09-30 21:12:51)

Offline

#46 2008-09-30 07:16:54

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

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

macTigers wrote:

Hi again adi. I tried it and it worked great. But then I realized, that it was not what I really intended. If I clicked on a child section’s link in my sub navigation, this section would become active, but the parent section inactive. Therefore all the other child sections would disappear.

I see your problem, so I’ve modified the functionality of the include_current="1" attribute so that it now includes the current section’s parent as well. That way the current section’s siblings are brought back to the party.

It got me thinking about tabbed menus and the possibility that the parent of an active child might need to be made active as well. So there’s a new attribute, active_parent="1", which will do this. At the moment it only affects the immediate parent, not any grandparents, but it might come in handy.

Here’s yet another version 0.6.

And just for the record, this is what I’m using to test your navigation requirement:

<txp:adi_menu menu_id="nav" include_children="0" active_parent="1" />
<txp:adi_menu menu_id="subnav" include_current="1" include_parent="0" />

Offline

#47 2008-09-30 21:10:50

macTigers
Member
From: Bernkastel-Kues
Registered: 2008-08-13
Posts: 10

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

Thanks again Adi!

This is exactly what I needed. I didn’t expect you to do this job. But WOW! I tried it and 5 minutes later I had what I was looking for! Super! The active_parent attribute isa great idea too.

Last edited by macTigers (2008-09-30 21:12:14)

Offline

#48 2008-10-02 19:28:42

FireFusion
Member
Registered: 2005-05-10
Posts: 698

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

Great plugin!

Could there be an option to only show the articles of the currently active section in the menu?

Offline

Board footer

Powered by FluxBB