
Query Navigator
Components User's Guide
101
<script language=JavaScript">
node[i] = new Array("Contacts", "contacts.html", 2, 0);
i++;
</script>
If the variables
node
and
i
are defined in the
<head>
section of a page, the values stored
in these variables are then available to any JavaScript function on the page. For example,
to define these variables, add the following to the
<head>
section of the page:
<script language="JavaScript">
var node = new Array();
var i = 0;
</script>
You can then use these variables to store and write node values to the page. For example,
if you place the following code in the body of your HTML page:
<nexus:component classid="nexus/components/NavMap"
code="$nexusComponents" dwcomptype="navmap" sitestructure="/
website/website.site">
<script language="JavaScript">
node[i] = new Array("$node.name","$node.url",$node.level,
$node.children);
i++;
</script>
</nexus:component>
<script language="JavaScript">
var n;
var indent = 20;
for(x = 0; x < i; x++)
{
n = "<img src='" + "clear.gif" + "' height='1' width='" +
node[x][2] * indent + "'>
<a href='" + node[x][1] + "'>"
+ node[x][0] + "</a><br>";
document.write(n);
}
</script>
And there are just two nodes in the site structure (
Home
and
Contact
), then a simple
link will display for each node, as defined by the
document.write(n)
statement:
Home
Contact
Query Navigator
Use the Query Navigator component to automatically create a navigation bar which allows
site visitors to navigate the results from an AssetQuery component. For each page that is
included in the AssetQuery result, the Query Navigator component can generate links to:
The next page in the query results
Commenti su questo manuale