Jump to content


Photo

Embed Spry Menu code in XML to update all pages?


  • Please log in to reply
No replies to this topic

#1 Nunez

Nunez

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 07 June 2011 - 05:21 PM

Hi guys, kinda noob here but I'm making a website for an organization in my community. I wanted to make a spry dropdown menu that I can edit in one place, and then have it update for all the pages. I've never used templates, so I was trying to insert the spry menu code into XML using the CDATA. Attached is the folder, the file I want it to look like is the 2_column_layout.html and what I have been testing on is the 2_column_xml_test.html which has casas.xml. attached to it. I'm not sure what is wrong, the spry menu shows up but it is not interactive as in the submenus don't open and close and there are no changes on hover.


I already updated the SpryNestedXMLDataSet.js I believe it is verion .07 or something like that. According to another forum I found, it was the latest version of the code. For Some reason the XML file will not upload, don't know how to upload the folders for everything else


the code for my 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>
<style type="text/css">
<!--
body {
}
#wrapper{
}
#nav_bar {
}
#banner {
}
#sidebar {
}
#sidebar2 {
}
#thumbs_column{
}
#content_wrapper{
}
#content {
}
#calendar{
}
#events{
}
-->
</style><meta name="keywords" content="proyecto de casas saludables, casas saludables, proyecto, pcs, healthier housing, leadership academies, city heights, mid city, immigration committee, committee, health, housing, academia, comite, liderazgo, talleres, salud, educacion, vivienda" />

<link href="[url="view-source:file:///media/943CE362F4C700EA/Documents%20and%20Settings/Aaron/Desktop/pcs_backup/new_casas/pcs_css.css"]pcs_css.css[/url]" rel="stylesheet" type="text/css" />
<script src="[url="view-source:file:///media/943CE362F4C700EA/Documents%20and%20Settings/Aaron/Desktop/pcs_backup/new_casas/SpryAssets/SpryMenuBar.js"]SpryAssets/SpryMenuBar.js[/url]" type="text/javascript"></script>
<script src="[url="view-source:file:///media/943CE362F4C700EA/Documents%20and%20Settings/Aaron/Desktop/pcs_backup/new_casas/SpryAssets/xpath.js"]SpryAssets/xpath.js[/url]" type="text/javascript"></script>
<script src="[url="view-source:file:///media/943CE362F4C700EA/Documents%20and%20Settings/Aaron/Desktop/pcs_backup/new_casas/SpryAssets/SpryData.js"]SpryAssets/SpryData.js[/url]" type="text/javascript"></script>
<script src="[url="view-source:file:///media/943CE362F4C700EA/Documents%20and%20Settings/Aaron/Desktop/pcs_backup/new_casas/SpryAssets/SpryNestedXMLDataSet.js"]SpryAssets/SpryNestedXMLDataSet.js[/url]" type="text/javascript"></script> <!-- added this in-->
<link href="[url="view-source:file:///media/943CE362F4C700EA/Documents%20and%20Settings/Aaron/Desktop/pcs_backup/new_casas/SpryAssets/SpryMenuBarHorizontal.css"]SpryAssets/SpryMenuBarHorizontal.css[/url]" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
var ds1 = new Spry.Data.XMLDataSet("casas_xml.xml", "casas_xml/record", {sortOnLoad: "navigation_xml", sortOrderOnLoad: "ascending"});
var ds1 = new Spry.Data.NestedXMLDataSet(ds1, "navigation_xml");
ds1.setColumnType("navigation_xml", "html");
//-->
</script>
</head>

<body class="body_style">

<div id="wrapper" class="wrapper_style">


<!-- THIS FOLLOWING STUFF IS WHAT I AM TRYING TO FIX, made it like this bcuz I thought it would work but didn't --> 

<div class="nav_bar_style" id="nav_bar">
  <ul id="MenuBar1" class="MenuBarHorizontal">
<div spry:region="ds1">{navigation_xml}</div>
</ul>
</div>

<div id="banner" class="banner_style"></div>

<div id="content_wrapper" class="content_wrapper">
  <div id="sidebar1" class="sidebar1_style">
    <div id="calendar" class="calendar_style">calendar will go here</div>
    <div id="events" class="events_style">expanding list of events will go here</div>
  </div>
  <!--End of sidebar1-->
  <div id="content_thumbs" class="thumb_style"></div>
  <div id="content" class="thumbs_column"> this is where all the main content will go this is where all the main content will gothis is where all the main content will gothis is where all the main content will gothis is where all the main content will go </div>
  <!--End of Text Content-->
</div>
<!-- End of Content Wrapper-->

</div><!-- End of Page Wrapper-->
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>




And the XML code i am using is
<casas_xml>
−
<record>
−
<navigation_xml>

	<li><a href="home.html">News</a>
    	<ul>
  	</ul>
	</li>
  	
  	<li><a href="whatwedo.html">About Us</a>
    	<ul>
     		<li><a href="whatwedo.html#our_mission">Our Mission</a></li>
      	<li><a href="whatwedo.html#our_history">Our History</a></li>
      	<li><a href="whatwedo.html#leadership_academies">Leadership Academies</a></li>
      	<li><a href="whatwedo.html#committees">Committees</a></li>
    	</ul>
	</li>
  	
  	<li><a href="whoweare.html">Archive</a>
    	<ul>
      	<li><a href="whoweare.html#newsletters">Newsletters</a></li>
      	<li><a href="whoweare.html#flyers">Flyers</a></li>
      	<li><a href="whoweare.html#articles">Articles</a></li>
    	</ul>
	</li>
  	
  	<li><a href="contribute.html">contribute</a>
    	<ul>
      	<li><a href="contribute.html#volunteer">volunteer</a></li>
    	</ul>
	</li>
  	
        	<li><a href="contact.html">contact</a>
    	<ul>
      	<li><a href="contact.html#our_office">Our Office</a></li>
      	<li><a href="contact.html#our_partners">Our Partners</a></li>
    	</ul>
	</li>
  	
  	<li><a href="casa.html">espa&ntilde;ol</a>
    	<ul>
      	<li visibility="false"></a></li>
    	</ul>
	</li>
	
</navigation_xml>
</record>
</casas_xml>

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users