Quantcast

Navigation visibility of subpages

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Navigation visibility of subpages

Jurian Sluiman
Hi all,

I have a question about the configuration of my pages, which has the following
structure:

- Home
  - Sub 1
  - Sub 2
    - Sub 2.1
    - Sub 2.2
  - Sub 3
    - Sub 3.1
  - Sub 4

I render a menu with the navigation view helper of only 2nd and 3rd order
menus (MinDepth = 1). Now my problem:
1) If home or subpage is active, show only only subpages
2) If subpage is active with subsubpages, expand that menu item with these
specific subpages
3) If subpage with subsubpages is active, do not show subsubpages of other
subpages

So: when "Subpage 2" is active, show "Sub 2.1" and "Sub 2.2" but NOT "Sub
3.1". I cannot accomplish this, is there any solution to this problem?

Regards, Jurian
--
Jurian Sluiman
Soflomo - http://soflomo.com

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Navigation visibility of subpages

Hector Virgen
Have you tried using setOnlyActiveBranch()?

echo $this->navigation()->menu()->setOnlyActiveBranch(true)->menu();

--
*Hector Virgen*
Sr. Web Developer
http://www.virgentech.com
--
Hector Virgen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Navigation visibility of subpages

Jurian Sluiman
On Wednesday 11 May 2011 06:03:34 Hector Virgen wrote:
> Have you tried using setOnlyActiveBranch()?
>
> echo $this->navigation()->menu()->setOnlyActiveBranch(true)->menu();
>
> --
> *Hector Virgen*
> Sr. Web Developer
> http://www.virgentech.com

Hi Hector,

The setOnlyActiveBranch will not display the whole menu on 2nd level if you
visit the 3rd level of pages (thus only the 2nd level page which is the 3rd
level page you visit).

I solved the problem by a frontcontroller plugin which sets subpages to
visible when a 2nd level page or 3rd level page is visited. It is an extreme
custom made solution, but unfortunately the only option I found. By default,
3rd level pages are invisible and become visible by the plugin's activation. I
have posted the code here: http://pastie.org/1888160

An example of my use case (in Dutch only): http://innogration.soflomo.com. You
can visit the sitemap to see the structure
http://innogration.soflomo.com/nl/sitemap.

Regards, Jurian
--
Jurian Sluiman
Soflomo - http://soflomo.com

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Loading...