PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > macromedia.dyna.html > XML data for Spry Menu ?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
XML data for Spry Menu ?

Réponse
 
LinkBack Outils de la discussion
Vieux 15/04/2008, 09h45   #1
akribie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut XML data for Spry Menu ?

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.



  Réponse avec citation
Vieux 15/04/2008, 13h59   #2
Ken Ford
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: XML data for Spry Menu ?

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.
>
>
>


  Réponse avec citation
Vieux 15/04/2008, 15h47   #3
akribie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: XML data for Spry Menu ?

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.
  Réponse avec citation
Vieux 17/04/2008, 05h37   #4
MikeL7
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: XML data for Spry Menu ?

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>&nbsp;</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>&nbsp;</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>

  Réponse avec citation
Vieux 17/04/2008, 07h39   #5
akribie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: XML data for Spry Menu ?

That's very good of you.

I'll build on that to solve my problem.

Many thanks.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h19.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14356 seconds with 13 queries