We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16183
    • 1,390 Posts
    Quote from: tinuviel at Dec 29, 2008, 06:45 AM

    I know, I was just short-terming it for the forum. My call is this:

    [[Wayfinder? &startId=`0` &level=`1` &outerTpl=`TopMenuUl` &parentRowTpl=`TopMenuLiWSub` &rowTpl=`TopMenuLi`]]


    Hmmm, not sure I understand you correctly...

    One thing I notice though from your Wayfinder call is that you have &level=`1` - meaning that only one level of your menus is being output. This means that your menu items are not parents, according to Wayfinder, since they do not have their sub-documents being displayed in the menu (in your MODx manager hierarchy they are still parents though wink - I think this is the issue. So, WF is treating them as non-parent row items, thus the application of your &rowTpl class. Change the parameter to &level=`2` to show the main level items and their IMMEDIATE sub-level documents.

    To hide the sub-menus unless their parents are active, use the &hideSubMenus parameter, like so

    &hideSubMenus=`1`


    1=true - but you probably know this  smiley

    Your call could then look like so:

    [[Wayfinder? &startId=`0` &level=`2` &outerTpl=`TopMenuUl` &parentRowTpl=`TopMenuLiWSub` &rowTpl=`TopMenuLi` &hideSubMenus=`1`]]


    cool site btw...like your designs too laugh

    cheers/k
      • 30088
      • 47 Posts
      Yes, I already figured all that out. My question is how to hide the ACTIVE submenu, because it will screw up the entire template if that’s shown, and as we already determined - I have to set the Level to 0. Is this even possible?
        • 16183
        • 1,390 Posts
        Quote from: tinuviel at Dec 29, 2008, 07:55 AM

        My question is how to hide the ACTIVE submenu, because it will screw up the entire template if that’s shown,  Is this even possible?

        Sorry  I still don’t follow. What do you mean "hide" the ACTIVE submenu? Do you mean you want them to be output by Wayfinder but that they should be hidden? OR do you mean that they should not be output at all?

        Secondly, what do you mean by Active submenu? The currently active sub-menu or the sub-menus visible on the template you are using?

        Maybe write down some text (showing your menu items with indentations, etc) of what you are trying to achieve?

        /k

        edit: have a feeling that if this cannot be solved using WF alone, you can use PHx or some similar snippet - just a feeling..
          • 7231
          • 4,205 Posts
          You can use the parentClass parameter and handle the differences with the css. This will work because it uses the is conttainer parameter to define if it is a parent rather than if there are any active children.
          &parentClass
              default: NULL
              values: name of class
              description: The parentClass will be applied to each item that has children (is a folder).


          On that note you could use a snippet in your rowTpl to check to see if the current doc is a container and output the additional markup if needed.
          <?php
          // sample call: [!isParent? &docid=`[+wf.docid+]`!]
          // get ID of document
          $docid = isset($docid) ? $docid : "";
          
          // check if is container
          $parent = $modx->getDocument($docid, 'isfolder');
          
          // do logic
          if ($parent['isfolder'] == "1") {
          	// is folder then return desired output
          	$output = "»"; // <- put the desired output here
          } else {
          	//is not folder so return nothing
          	$output = "";
          }
          
          // send output to modx
          return $output;
          
          ?>


          then in the rowTpl add the snippet to the structure:
          <li[+wf.classes+]>
          	<a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+][!isParent? &docid=`[+wf.docid+]`!]</a>
          	[+wf.wrapper+]
          </li>
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 30088
            • 47 Posts
            Thank you, dev_cw! That’s perfect - exactly what I was looking for.
              • 16183
              • 1,390 Posts
              Brilliant...solved... grin