OK,
Here’s an alternative method. Could have posted earlier but spent some time trying to find out why my menus were not being output....it’s so embarrassing! I had wrapper instead of wf.wrapper in my chunks!. Anyway....
Tested, working fine and validates. Only "issue" is that top level menu items without child docs, e.g. "Home" in the example above, get an empty div. When hovered it shows.
Here goes....
1. Create a 3 level menu
first level - Home, Logo Design, Stuff for Inspiration, About us, Contact
Second level - Logo, Branding, Design Tutorials etc - respectively
3rd level - Corporate, Small Business, Business cards, etc - respectively
2. Create 5 chunks for outerTpl, rowTpl, innerTpl, innerRowTpl and categoryFoldersTpl
Here are the chunks
outerTpl
<ul id="menu"[+wf.classes+]>[+wf.wrapper+]</ul>
rowTpl
<li class="mega">
<h2><a href="[+wf.link+]">[+wf.linktext+]</a></h2>
<div>[+wf.introtext+][+wf.wrapper+]
[+extras+]
</div>
</li>
<!-- NOTES: introtext here = can be wrapped in p tags if needed.
Example in your sample page is the "Contact" page "lorem ipsum"
The [+extras+] is a TV that will hold the extra text such as "40% of, etc". See point 5 below -->
innerTpl
[+wf.wrapper+]
<!-- NOTES: this will just contain the wrapper tag so that sub-menus can be inserted -->
categoryFoldersTpl <!-- This will be used for the 2nd level menu items which will not be clickable. -->
<h3>[+wf.linktext+]</h3><p>[+wf.wrapper+][+more+]</p>
<!-- NOTES: The <p> </p> tags surrounding wf.wrapper ==> These will enclose the sub-menu items that are in the 3rd level
Also note the TV "more" ==> this will contain the "More..." link for respective categories. See explanation in point 4 below.
-->
innerRowTpl <!-- This will be used by the 3rd level menu items -->
<a href="[+wf.link+]">[+wf.linktext+]</a>,[+wf.wrapper+]
And the Wayfinder call
[[Wayfinder? &startId=`0` &outerTpl=`megaouterTpl` &rowTpl=`megarowTpl` &innerTpl=`megainnerTpl` &categoryFoldersTpl=`megacategoryFoldersTpl` &innerRowTpl=`megainnerRowTpl` ]]
4. "More...." - I have used a TV for this. I created a
text TV and called it more. Obviously assigned it to the template my documents will be using. Within the "more TV" for the respective documents that are categories, e.g. "Design Tutorials", "Inspiration", etc, I added the code/text for the more link....e.g. <a href="[~id~]">More...</a>. Using and placing the TV in the right spot ensures no matter how many new menu items are dynamically added, the "More.." link will always be last.
5. The extras, i.e. the "More stuff for Branding"/"More stuff for Designers" =>
I decided to use a TV for this...
- Create a TV for extra material, e.g. the "40% off" text. I prefer a
text area TV for this. Called mine extras
Remember in WF you call it like so [+extras+]
- Add the TV to the rowTpl as shown above in the rowTpl code. This way, its content will be displayed after the sub-menus
Examples:
Example 1
The text for the extras TV for the "Clearance, 40% etc" ==> I added this to the "extras TV" of the document at the
highest level of the menu for this group, i.e. "Logo Design" in the sample site above (in my tests it is Corporate Branding). Here’s the code/text:
<h3>Clearance!</h3>
<p>40% off all design books this weekend only. <a href="[~39~]">Don't miss out</a></p>
<p><a href="[~39~]" class="more">More stuff for Branding...</a></p>
Example 2
The text for the extras TV for the "Get Latest Photoshop at discounted price! etc" ==> Again I added this to the "extras TV" of the
document at the highest level of the menu for this group, i.e. "Stuff for Inspiration".
Here’s the code/text:
<h3>Get Latest Photoshop at discounted price!</h3>
<p>Pre-Release Software.<a href="[~39~]">Shop early, save on shipping! </a></p>
<p><a href="[~15~]" class="more">More stuff for Designers...</a></p>
Screenshots
EDIT:
1. Added p tags around the wf.wrapper of the categoryFoldersTpl. This will surround the <a> tags that are the innerRowTpl just like in the sample code provided by MT.
2. Removed the wf.introtext from the categoryFoldersTpl; using TVs instead (within the rowTpl)
3. Added the TV "extras" to the rowTpl
4. Removed the wf.introtext from the innerRowTpl; using TVs instead
5. Added the TV "more" to the categoryFoldersTpl
6. Removed wf.title from the tpls.
cheers/k
Hey, this is my 666th post! I won’t post for a while and let this sink in, ha!