We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1454
    • 11 Posts
    Hi,
    Newbie Wayfinder question. I have combed the forum looking for an answer.

    I have a simple horizontal menu:
    join | videos | restaurants| clubs | contact

    Where "join"(7), "videos"(2) and "contact"(3) are in the top directory and "restaurants"(5) and "clubs"(6) are in a subdirectory called "listing pages"(4). When I move restaurants and clubs to the folder "listing pages" it disappears from the horizontal menu.

    Here is my code in my chunk called "header":
    [!Wayfinder?startId=`0` &includeDocs=`7,2,3,5,6`!]

    I think I am overlooking the simple solution.
    Please help!
      Knowledge is power...ignorance is bliss.
      • 21496
      • 225 Posts
      You can’t show documents that are children, if the parent is not part of the menu. So if your docs 5 and 6 are in the folder 10, and folder 10 is not included in your wayfinder call, its children are not displayed, even if you include them explicitly.

      If you dont want to have those documents from the folder "listing pages" in the root of the document tree, you can create two weblinks, selecting the docs in "listing pages" as the targets for the link (by inserting the id). The weblinks are getting their own id and you can use them in the include parameter of wayfinder, and they are just redirecting to your documents.



        René
        • 7231
        • 4,205 Posts
        The includeDocs is not as simple as it would seem and the results are not always as expected.

        I put together a simple snippet for a project that allows you to determine the docs independent of the doc tree. It is a bit specific to my needs but check it out and tweak it to your own needs. Note it uses GetField snippet to get the document info to use in the list so any document or template variable can be used.

        <?php
        // Build simple list menu based on array of doc ids
        // Note: must have GetField snippet installed
        // sample call: [[SimpleMenu? &docIds`1,2,3` &activeId=`2` &title=`longtitle`]]
        
        $docIds = isset($docIds) ? $docIds : '';
        $docId = explode(',', $docIds);
        $activeId = isset($activeId) ? $activeId : $modx->documentIdentifier;
        $title = isset($title) ? $title : 'pagetitle';
        $output = '';
        
        $output = '<ul>';
        
        foreach ($docId as $z) {
        	$y = $modx->runSnippet("GetField", array("docid" => $z, "field" => $title ));
        	if($z == $activeId) {
        		$output .= "<li class='active'><a href='[~$z~]' title='$y'>$y</a></li>";
        	} else {
        		$output .= "<li><a href='[~$z~]' title='$y'>$y</a></li>\n";
        	}	
        }
        
        $output .= '</ul>';
        
        echo $output;
        
        ?>
          [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]
          • 1454
          • 11 Posts
          Excellent! Thanks for the fast help. grin
            Knowledge is power...ignorance is bliss.