Navigation woes


(Conradr) #1

Hey everyone, 

 

Can anyone help as to the best approach here:

 

I'm trying to build a breadcrumb navigation and dropdown and my site structure is similar to:

 

Home

|

 - Advice 

   |

     -- Advice Category 1

        |

        |- - - Advice Page 1.1

        |- - - Advice Page 1.2

                |- - - - Advice Page 1.2.1

                |- - - - Advice Page 1.2.2

        |- - - Advice Page 1.3

   |

     - - Advice Category 2

      |

      |- - - Advice Page 2.1

 

 

 

When the user is on Advice Page 1.1 (child of Category 1)  the navigation should output in dropdowns:

 

Advice - Advice Category 1      -  Advice Page 1.1       

              Advice Category 2      -   Advice Page 1.1       

                                                 -   Advice Page 1.3

 

Effectively display

The brothers of the current page the user is on in dropdown 2 

The parent and uncles in drop down 1

 

 

Another example: 

When the user is on Advice page 1.2.1 (grandchild of 1, child of 1.2)  the navigation should output in dropdowns:

 

Advice - Advice Category 1      -  Advice Page 1.2       -  Advice Page 1.2.1

              Advice Category 2      -   Advice Page 1.1        -  Advice Page 1.2.2

                                                 -   Advice Page 1.3

 

Effectively display

The brothers of the current page the user is on in dropdown 3 

The parent and uncles in drop down 2

The grandparent and grand uncles in dropdown 1

 

Hope that makes sense! 

 

 


(Bart Banda) #2

Hi gamma,

If I understand correctly, you are after a very standard menu output where the current page shows the children and also shows the siblings of all its parent hierarchy.

 

Can you try following the example in the manuals to see if this is what you are after? http://manuals.matrix.squizsuite.net/designs/chapters/menu-normal-design-area#Example 


(Conradr) #3

Unfortunately the standard menu output doesn't format the html correctly. It nests lists within lists which is fine for a menu but not for my use.

 

I need children and parents to be separate from grandparents and great uncles.

 

So I've resorted to asset listings which is working great for the grandparents in one list and the parents and siblings in another but it's not working for grandparents and great uncles ( confusing!!)

 

Any thoughts?

 


(Bart Banda) #4

Ok, so for each parent asset from the current viewed one, you want to list its siblings? Is that the right understanding?


(Conradr) #5

Yes correct


(Bart Banda) #6

I could think of a couple of hacky ways around this, but they are probably not worth it in terms of processing cost. Can you just use JS to tweak the HTML slightly to the closest output possible you can get with just asset listings of the menu design area?


(Tbaatar) #7

Little late for reply but I thought it would be good idea to post it for future reference.

 

This is the basic code required to list current parent / child navigation by using asset lineage and normal menu design. 

You can add deeper level to the the normal menu design area to create the child / parent / grand parent structure.

 

The only negative with this approach is that you can't set class to the asset lingeage with Matrix keyword, however easily doable with JS.

 

As far as I can tell there is n performance hit on load times.