Hello,
I’ve created the following Wayfinder call for the main menu of this site (
harmony.adrenalineonline.net - still in development) and it works wonderfully:
<div class="menu">[!Wayfinder?&level=`1`&config=`harmonymenu`&startId=`[*Parent*]!]</div>
Note, I’m a little confused that the [*Parent*] element doesn’t work if I put a closing tick after it but that’s not a primary concern at the moment.
The config file for reference:
<?php
$firstClass = 'first';
$lastClass = 'last';
$hereTpl = '';
$outerTpl = '@CODE:<ul>[+wf.wrapper+]</ul>';
$rowTpl = '@CODE:<li [+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]"><strong>[+wf.linktext+]</strong><br /><span class="itemdescription">[+wf.introtext+]</span></a>[+wf.wrapper+]</li>';
?>
Certain sections of the site will have submenus. For now I’m using one page to start building on, the Environment page (
harmony.adrenalineonline.net/Environment).
My objective is to have the submenu call in the master template. Currently I have this:
<div class="submenu">[!Wayfinder?&level=`2`&config=`harmonysubmenu`&startID=`[*Parent*]!]</div>
With the config file:
<?php
$firstClass = '';
$lastClass = '';
$hereTpl = '';
$outerTpl = '@CODE:<ul>[+wf.wrapper+]</ul>';
$rowTpl = '@CODE:<li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>';
?>
I haven’t styled the submenu yet (will do so after it gets working) but it does display on the environment page. It disappears, however, if you click on one of the pages in the submenu. I thought it might have something to do with the startId but this call:
<div class="submenu">[!Wayfinder?&level=`2`&config=`harmonysubmenu`!]</div>
Works the same way. I’m pretty confused and realize it’s probably something very simple.
As for the tree, the pages that make up the items in the main menu are at the root level and the pages that make up the items for the submenus will be (and are in the Environment section) children of the relevant parent page.
Can anyone point out what I’m doing wrong/why the submenu disappears on the children page?