|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I maintain several web sites with static pages that all carry a common Spry
menu bar hard coded into each page via a template. How can I use an XML file to feed a Spry menu widget to save uploading all the pages every time there is a change on the site that requires the menu to be updated? I've searched the web and files for an answer to this without success, so any or pointers would be most appreciated. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Why not make the menu a server-side include?
That way when the menu changes all you need to do is upload one file. -- Ken Ford Adobe Community Expert - Dreamweaver Fordwebs, LLC http://www.fordwebs.com "akribie" <webforumsuser@macromedia.com> wrote in message news:fu1pv7$q9v$1@forums.macromedia.com... >I maintain several web sites with static pages that all carry a common Spry > menu bar hard coded into each page via a template. > > How can I use an XML file to feed a Spry menu widget to save uploading all > the > pages every time there is a change on the site that requires the menu to > be > updated? > > I've searched the web and files for an answer to this without > success, so > any or pointers would be most appreciated. > > > |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Thanks for that thought.
It would still seem like a useful feature to allow Spry menus to be constructed in an external XML file, though. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
I made this example that uses a xml file to build the spry menu, the page is
html, you need to make a seperate dataset for each [BULLET] tag, or item group in the menu, notice the two datasets in my sample, you could expand and make as many as you want, all drawn from xml files. check out the page here: http://gohbcc.com/examples/menutest.html html page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <script src="SpryAssets/xpath.js" type="text/javascript"></script> <script src="SpryAssets/SpryData.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!-- var ds1 = new Spry.Data.XMLDataSet("s.xml", "links/link"); var ds2 = new Spry.Data.XMLDataSet("t.xml", "links/link"); //--> </script> </head> <body> <ul id="MenuBar1" class="MenuBarHorizontal"> [LI]<a class="MenuBarItemSubmenu" href="#">Item 1</a> [BULLET] <div spry:region="ds1"> <li spry:repeat="ds1"> <a href="{a/@href}">{a}</a> </li> </div> [LI]<a href="#">Item 1.1</a></li> [LI]<a href="#">Item 1.2</a></li> [LI]<a href="#">Item 1.3</a></li> [/BULLET] </li> [LI]<a href="#">Item 2</a></li> [LI]<a class="MenuBarItemSubmenu" href="#">Item 3</a> [BULLET] <div spry:region="ds2"> <li spry:repeat="ds2"> <a href="{a/@href}">{a}</a> </li> </div> [LI]<a href="#">Item 3.2</a></li> [LI]<a href="#">Item 3.3</a></li> [/BULLET] </li> [LI]<a href="#">Item 4</a></li> [/BULLET] <p> </p> <div spry:region="ds1" style="float:right;"> <table> <tr> <th>A</th> <th>A/@href</th> </tr> <tr spry:repeat="ds1"> <td>{a}</td> <td>{a/@href}</td> </tr> </table> </div> <p> </p> <script type="text/javascript"> <!-- var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> </body> </html> XML Files t.xml; <?xml version="1.0" encoding="utf-8"?> <links> <link><a href='customer_enter.php?method=Fname'>First Name</a></link> <link><a href='customer_enter.php?method=caseNum'>Case Number</a></link> <link><a href='customer_enter.php?method=Lname'>Last Name</a></link> <link><a href='customer_enter.php?method=caseWorker'>Case Worker</a></link> </links> s.xml: <?xml version="1.0" encoding="utf-8"?> <links> <link><a href='customer_find.php?method=name'>By Name</a></link> <link><a href='customer_find.php?method=caseNum'>By Case Number</a></link> <link><a href='customer_find.php?method=date'>By Date</a></link> <link><a href='customer_find.php?method=itemNum'>By Item Number</a></link> </links> |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
That's very good of you.
I'll build on that to solve my problem. Many thanks. |
|
![]() |
| Outils de la discussion | |
|
|