We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8790
    • 526 Posts
    Hi all

    Not sure of doing the right things in building a quit special menu. And it’s my first try with templating WF..
    0 -| --products
    | -- cat1 (50)
    | -- sub-cat1 (52)
    | -- item1 (62)
    | -- item2 (63) ....

    | -- sub-cat2 (65)
    | -- sub-cat3 (66)
    | -- sub-cat4 ....
    | -- cat2 (51)...

    Purpose is to display an independent menu that lists all Categories without the sub-categories. This is ok.
    [!Wayfinder? &startId=`50` &level=`1` &outerClass=`menug-stru-2` &firstClass=`first` &hereClass=`active` &lastClass=`last` !]


    Then when clicking on a sub-cat, display ANOTHER menus -- YES the previous nav is no more here, that’s the way is is asked -- but another WF menu is also added above not the discussion here.

    This sub menus list all the product item of this sub cat and it displays them using thumbnail pix.This is OK
    [!Wayfinder?   &rowTpl=`vignette-stru` &startIID`=`[*Parent*]` &level=`1`  &outerClass=`menug-stru-3` &firstClass=`first` &hereClass=`active` &lastClass=`last`!]

    associated tpl :
    <li [+wf.classes+]>
    <a href="[+wf.link+]" title="détails du produit  [+wf.linktext+]">
    <img src=assets/templates/cetav-stru/images/vignettes/stru-[+wf.docid+].gif height="86px" > 
    </a> 
    [+wf.wrapper+]
    </li>

    BUT when clicking the final item I want to KEEP the thumbnail menus present, but of course it "goes away", cause WF has nothing to display now..

    Am I forced to use another specifi tpl for each item ??

    Thank you for any suggestion to get the good direction.



      Schtroumpf Grognon - Grouchy Smurf
      ---------------------------------
      Faites pas attention.. - Don&#39;t pay attention
      http://www.dzi-neo.net
      • 11807
      • 21 Posts
        • 22303 MODX Staff
        • 10,725 Posts
        Search for the UltimateParent snippet, especially in relation to Wayfinder...
          • 8790
          • 526 Posts
          Sorry

          I forgot to switch this case to ’closed’.

          We have done something with a TV (ie "[good-id]" ) including this :
          @EVAL if ($modx->documentObject['isfolder']) {return $modx->documentObject['id']; }else{ return $modx->documentObject['parent'


          This automatically returns the parent id if we are NOT a folder (means in my case we are on the page into this parent folder) and returns the id of this folder if on it.

          This is elsewhere used by the wayfinder menu with
          &startId=`[*good-id*]`
          .

          Works only if you dont have more sub level.
            Schtroumpf Grognon - Grouchy Smurf
            ---------------------------------
            Faites pas attention.. - Don&#39;t pay attention
            http://www.dzi-neo.net
            • 12110
            • 122 Posts
            Hello,

            I just tried your great idea for getting the current doc’s parent id and sending it to Wayfinder, created a TV named [*baumParent*]
            @EVAL if ($modx->documentObject['isfolder']) {return $modx->documentObject['id']; } else {return $modx->documentObject['parent']}

            and called Wayfinder this way:
            [!Wayfinder?startId=`[*baumParent*]` !]


            It doesn’t work - nothing is showing up. Has this been for an older MODx Version - I’m using 0.9.6.1. -?? Tried the call with different level numbers also. The TV is allowed for the template. I can’t figure out what mistake am am dooing ... :-(

            Thanks if anybody can help, this would make possible only 1 and only 1 template instead of 1 for each folder/submenu.
              • 8790
              • 526 Posts
              hi,

              As this was done on Feb 2007, I guess it was 0.96.

              Honnestly I did not reminds exactly this story, may be a cache issue?
                Schtroumpf Grognon - Grouchy Smurf
                ---------------------------------
                Faites pas attention.. - Don&#39;t pay attention
                http://www.dzi-neo.net