Navigation Label - Design File


(Pwoodhouse) #1

Hi,

Just wondering if someone could help me out on this one. Should be easy for someone who knows what they are doing :)

 

We have a standard type left hand navigation on our sites, parent/children type of display. See attached.

 

I want to be able to print the name of the active parent page above the navigation in place of where we currently have "Page Menu".

 

What keyword/design tags would I use to acheive this?

 

Code looks like this -

 

 <MySource_AREA id_name="menu_leftnav" design_area="menu_normal" print="no" cache="1">     <MySource_SET name="level" value="sub" />
    <MySource_SET name="show_subs" value="on_current" />
    <MySource_SET name="settings.class.normal" value="default" />
    <MySource_SET name="settings.class.current" value="selected" />
    <MySource_SET name="settings.class.hierarchy" value="parent" />
    <nav class="group">
      <div class='page-menu-button'>Page Menu</MySource_ASSET></div>
      <div class="" id="page-nav-wrapper">
      <nav>
        <ul id="page-nav" role="navigation">
          <MySource_ASSET>
          <li class="top-level treenode id-<MySource_PRINT var='assetid' />-parent"><a href="<MySource_PRINT var='asset_link' />" id="leftnav-id-<MySource_PRINT var='assetid' />" class="<MySource_PRINT var='settings.class' />" title="<MySource_PRINT var='asset_metadata_design.menu.title' />"><MySource_PRINT var="asset_short_name" /></a>
          <MySource_SUB design_area="menu_normal" cache="1">
          <MySource_SET name="settings.class.normal" value="default" />
          <MySource_SET name="settings.class.current" value="selected" />
          <MySource_SET name="settings.class.hierarchy" value="parent" />
          <ul>
            <MySource_ASSET>

 

Thanks

Paula page-menu.png (37.4 KB)


(Pwoodhouse) #2

Would a breadcrumb approach be able to do this? Or is there a better way?

 

<MySource_AREA id_name="Breadcrumb" design_area="asset_lineage">     <MySource_SET name="levels_to_print" value="1" />
      <MySource_SET name="start_at_level" value="2" />
      <MySource_ASSET><span><a href="<MySource_PRINT var="asset_link"/>"><MySource_PRINT var="asset_short_name" /></a></span></MySource_ASSET>
      <MySource_DIVIDER></MySource_DIVIDER>
    </MySource_AREA>


(Douglas (@finnatic at @waikato)) #3

If by 'active parent page' you mean the parent of the current page, I'd suggest having a look at the asset_lineage design area - https://manuals.matrix.squizsuite.net/designs/chapters/asset-lineage-design-area- we do something where we print out the section that the page is within using that using code like:

 

         <MySource_AREA id_name="current_section" design_area="asset_lineage" print="no">
          <MySource_SET name="start_at_level" value="1" />
          <MySource_SET name="levels_to_print" value="1" />
          <MySource_SET name="suffix_with_current_link" value="true" />
          <MySource_SET name="suffix_with_divider" value="false" />
          <MySource_ASSET>
              <ul> 
                  <li><a href="<MySource_PRINT var='asset_link' />"><MySource_PRINT var="asset_short_name"/></a></li>
              </ul>
          </MySource_ASSET>
        </MySource_Area>

(Pwoodhouse) #4

Thanks Douglas for your reply, this should work!

Really appreciate your help :)


(Tim Davison) #5

We use the following to get the name of the 'section', i.e. the asset name of the top-level landing page that you're under regardless of how deep, rather than just the immediate parent.

Seems almost identical to what Douglas has except he defines 'start_at_level'.  Douglas, is this what makes it print the immediate parent?


(Douglas (@finnatic at @waikato)) #6

Seems almost identical to what Douglas has except he defines 'start_at_level'.  Douglas, is this what makes it print the immediate parent?

 

We're printing the parent below the site, not the immediate parent - my understanding was that having the 'start_at_level' set to 1 helped select that first level below the site.