We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5752
    • 10 Posts
    I’m using the following code to build up the navigation. Basically I exclusively writes API based code and tries to avoid chunks.

    $nav = $modx->runSnippet(
    		"Wayfinder", 
    		array(	"startId" => "0",
    				"level"=>"2",
    				"textOfLinks"=>"title", 
    				"outerClass" => "menu", 
    				"firstClass" => "first", 
    				"lastClass" => "last", 
    				"hereClass" => "here"
    			 )
    		); 


    Is it possible to set an alternative html output directly in this snippet call? I’ve tried som different procedure like;

    $nav = $modx->runSnippet(
    		"Wayfinder", 
    		array(	"startId" => "0",
    				"level"=>"2",
    				"textOfLinks"=>"title", 
    				"outerClass" => "menu", 
    				"firstClass" => "", 
    				"lastClass" => "", 
    				"hereClass" => "",
    				"outerTpl" => '<ul id="topnav"[+wf.classes+]>[+wf.wrapper+]</ul>'
    			 )
    		);
    


    The outerTpl parameter doesn’t affect the output at all. What am I doing wrong. Is there an other way of alter the output by code/API?
      • 36442
      • 97 Posts
      Try adding @CODE: before template content:
      "outerTpl" => '@CODE:<ul id="topnav"[+wf.classes+]>[+wf.wrapper+]</ul>'