Quote from: Arsenic at Aug 29, 2008, 10:41 AM
rx2, how do you place main navigation and subnavigation into different places of html code? I can’t seems to separate wayfinder navigation’s main and submenus into different <ul> elements 
You can make multiple calls. For example, the main navigation call is this:
[[Wayfinder?&level=`1`&config=`mainmenu`&startId=`0`]]
With a config file that looks like this:
<?php
$lastClass = 'last';
$hereClass = 'active';
$outerTpl = '@CODE:<ul id="main-nav">[+wf.wrapper+]</ul>';
$rowTpl = '@CODE:<li><a[+wf.classes+] href="[+wf.link+]" title="[+wf.title+]"><strong>[+wf.linktext+]</strong><br />[+wf.introtext+]</a></li>';
?>
Which produces this:
<ul id="main-nav"><li><a class="active" href="http://harmony.adrenalineonline.net/" title="Harmony Printing Limited"><strong>home</strong><br />the first page</a></li>
<li><a href="/The-Harmony-Team" title="The Harmony Team"><strong>the team</strong><br />get to know us</a></li>
<li><a href="/Environment" title="Environment"><strong>environment</strong><br />we help you go green</a></li>
<li><a href="/Workflow" title="Workflow"><strong>workflow</strong><br />an organic model</a></li>
<li><a href="/Print" title="Print"><strong>print</strong><br />we speak cmyk</a></li>
<li><a href="/Mailing-Services" title="Mailing Services"><strong>Mailing Services</strong><br />optimized delivery</a></li>
<li><a href="/New-Media" title="New Media"><strong>new media</strong><br />we speak html</a></li>
<li><a href="/Harmony-Blog" title="The Harmony Blog"><strong>blog</strong><br />thought provoking</a></li>
<li><a class="last" href="/Contact-Harmony" title="Contact Harmony"><strong>contact us</strong><br />let's connect</a></li>
</ul>
Which, except for the lack of a carriage return in code is exactly like the static XHTML/CSS page created as a template before moving into MODx (and the addition of a title attribute). I’m not sure why therefore, it isn’t displaying properly but that’s another matter.
The key is in the config file which you place under the configs folder in the wayfinder folder under the snippets folder. You only have to refer to the name of the file and not the extensions. For example, in my case, it’s mainmenu.config.php. I’ve made sure that the active and last classes are in use (though I believe active is a default anyway.) Then I ensure the structure of the unordered list by defining both the outer template and the row template appropriately. You use placeholders to have MODx automatically place what needs to be placed where. In my case, I’m drawing the little descriptive text from the intro text field, hence the use of the wayfinder placeholder [+wf.introtext+].
For the sub menu I have the following call:
[!Wayfinder?&config=`submenu`&startId=`[[UltimateParent]]`!]
And the submenu.config.php has this:
<?php
$outerTpl = '@CODE:<ul id="sub-nav">[+wf.wrapper+]</ul>';
$rowTpl = '@CODE:<li><a href="[+wf.link+]"[+wf.classes+] title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>';
?>
Note how I did not have to define the active class because it is a default. UltimateParent is a snippet that travels up the document tree automatically. In this case, it travels to the top which is any document at the top level of the tree, as far as I understand at least, thus avoiding the need to identify an explicit and specific start ID for the sub menus.
I’ve read all the documentation over and over again, and I will, when I have time, sit down and sketch things out as I’m a very structural thinker and react to visual wireframes and how they relate to code, but I cannot for the life of me figure out how to create the menus in the footer. It’s evident that no one else has done anything like it as well so I’ll just do it manually for now.