Top level menu

Hey guys,


Is there any way of printing, from the parse file, just the top level menu ( a mysource_print value? ) for the current asset?



What I've got a menu structure like this;


    Top 1
     + Next 1
     + Next 2
     + + More 1
     + + More 2
     + + + Etc 1
     + + + Etc 2
     + + + Etc 3
     + + More 3
     + Next 3
    Top 2
     + Next 4
     + Next 5
     + + More 4
     + + More 5
    Top 3


The way it's being displayed is with the Top menus displayed along the top of the page, The Next menus down the left with More and Etc as flyouts from the Next menu items.

At the top of the left menu we want to display which Top menu we're currently in.

e.g.;
                                              Top 1 - Top 2 - Top 3 
Top 2         More 4
Next 4        Content for More 4
Next 5</pre><br />


I've got it working but it's a bit of a hack. This is what I've done to get it working (just in case anyone else wants to use it and there isn't a more elegant method at this point...

      
        
        
        
        
          
            

       


The CSS for .hidden is basically display:none

I did say it was a bit of a hack. :)

Any better ways of doing this?

You could do it with an asset_lineage design area, with levels_to_print=1. That way, it'll only print the first (i.e. Top) level of the lineage. Just make sure you don't prefix with the Home link. :slight_smile:


Edited to add sample HTML:



[html]<MySource_AREA id_name="top-heading" design_area="asset_lineage">

<MySource_SET name="levels_to_print" value="1" />

<MySource_SET name="prefix_with_home_link" value="false" />

<MySource_SET name="prefix_with_divider" value="false" />

<MySource_SET name="suffix_with_divider" value="false" />

<MySource_ASSET>

<h2><MySource_PRINT var="asset_short_name" /></h2>

</MySource_ASSET>

</MySource_AREA>[/html]

Didn't quite work. If, for example, I'm at Top 3 then Top 3 didn't appear. Once I'd drilled down into a sub page it worked though.

Ah, sorry – my bad. Add:


[html]<MySource_SET name="suffix_with_current_link" value="true" />[/html]

That seems to have done the trick.


Cheers Avi.

No problemo.