Hi,
I wish to change the XML output that wayfinder generates so that it looks like that below. The reason is that I have a flash menu which seems only to want it in that format. Can anyone help please. Thanks.
<?xml version="1.0"?>
<MENU>
<FOLDER NAME="About Us">
<FILE NAME="Submenu Link 1" LINK="sub1.swf" />
<FILE NAME="Submenu Link 2" LINK="sub2.swf" />
<FILE NAME="Submenu Link 3" LINK="sub3.swf" />
<FILE NAME="Submenu Link 4" LINK="sub4.swf" />
</FOLDER>
<FOLDER NAME="News" LINK="news.swf">
<FILE NAME="Submenu Link 1" LINK="sub1.swf" />
<FILE NAME="Submenu Link 2" LINK="sub2.swf" />
<FILE NAME="Submenu Link 3" LINK="sub3.swf" />
</FOLDER>
<FOLDER NAME="Services">
<FILE NAME="Submenu Link 1" LINK="sub1.swf" />
<FILE NAME="Submenu Link 2" LINK="sub2.swf" />
<FILE NAME="Submenu Link 4" LINK="sub4.swf" />
<FILE NAME="Submenu Link 4" LINK="sub4.swf" />
<FILE NAME="Submenu Link 4" LINK="sub4.swf" />
</FOLDER>
<FOLDER NAME="Contact" LINK="contact.swf"/>
</MENU>
-
☆ A M B ☆
- 24,524 Posts
Yes, it can be done. Your "outerTpl" will have the opening and closing XML lines, your "parentTpl" will have the opening and closing FOLDER tags, and your "rowTpl" will have the innermost tags. You’ll need to name your swf files so that the Wayfinder placeholders can be put to good use.
Examine the documentation’s section on the templates, and you should be able to see how it would work.
http://wiki.modxcms.com/index.php/Wayfinder200
Thank you. I have most of it working but stumped on the following: The inner part which takes the parameter [+wf.wrapper+] makes the lines appear like so:
<a href="/index.php?id=10" title="test">test</a>
But I need it to appear like:
<FILE NAME="test" LINK="/index.php?id=10" />
How do I change that. Any suggestions as I can ’t see it in the documentation.
May thanks again.
Many thanks GaneshXL,
That seemed to work. Thank you. I’m nearly there, this is what I’m now getting:
<ul>
<FILE NAME="Congratulations!." LINK="/index.php?id=1"/>
<FOLDER NAME="Duplicate of Congratulations!." LINK="/index.php?id=5">
<ul>
<FILE NAME="test" LINK="/index.php?id=10"/>
</ul>
</FOLDER>
<FILE NAME="Duplicate of Galeria" LINK="/index.php?id=6"/>
<FOLDER NAME="test2" LINK="/index.php?id=7">
<ul>
<FILE NAME="page1" LINK="/index.php?id=8"/>
</ul>
</FOLDER>
<FOLDER NAME="Contact" LINK="/index.php?id=3">
</FOLDER>
<FILE NAME="xml" LINK="/index.php?id=9"/>
</ul>
I need to get rid of the <ul></ul> which seem to appear in the &rowTpl element. Any ideas? Thanks again for your help.
The problem is that I need the <ul></ul> at the start and end of the XML. I’ve now called it <MENU></MENU>. It just seems to appear everywhere:
<MENU>
<FILE NAME="Congratulations!." LINK="/index.php?id=1"/>
<FOLDER NAME="Duplicate of Congratulations!." LINK="/index.php?id=5">
<MENU>
<FILE NAME="test" LINK="/index.php?id=10"/>
</MENU>
</FOLDER>
<FILE NAME="Duplicate of Galeria" LINK="/index.php?id=6"/>
<FOLDER NAME="test2" LINK="/index.php?id=7">
<MENU>
<FILE NAME="page1" LINK="/index.php?id=8"/>
</MENU>
</FOLDER>
<FOLDER NAME="Contact" LINK="/index.php?id=3">
</FOLDER>
<FILE NAME="xml" LINK="/index.php?id=9"/>
</MENU>
I’m not sure what I’m dong wrong but it doesn’t seem to work. I just need to remove the <ul></ul> tags from the submenu. This is what I have:
[[Wayfinder? &startId=`0` &level=`3` &parentClass=`hide` &parentRowTpl=`cssplay_parentRow` &outerTpl=`cssplay_outer`&innerTpl=`cssplay_inner` &rowTpl=`cssplay_row`]]
//CHUNKS
****cssplay_inner********
<ul [+wf.classes+]>
[+wf.wrapper+]
</ul>
*****cssplay_parentRow********
<FOLDER NAME ="[+wf.title+]" LINK="[+wf.link+]">[+wf.wrapper+]
</FOLDER>
******cssplay_row*****
<FILE NAME="[+wf.title+]" LINK="[+wf.link+]"/>
the inner row needs to be only this::
[+wf.wrapper+]