MACROMEDIA CONTRIBUTE 3-DEPLOYING CONTRIBUTE Guide de l'utilisateur Page 99

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 142
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 98
NavMap
Components User's Guide
99
The following component provides a basic example of how you might do this, using a very
simple JavaScript:
<nexus:component classid="nexus/components/NavMap"
code="$nexusComponents" dwcomptype="navmap"
sitestructure="/website/ccs_sample.site">
<script language="JavaScript">
var indent = 20;
// children indent in pixels
document.write('<img src="' + 'clear.gif' + '" height="1"
width="' + $node.level * indent + '">
<a href="$node.url">$node.name</a><br>');
</script>
</nexus:component>
In this example, the script defines a variable called
indent
, which is set to
20
. Then, the
script writes an image statement which defines the width of the image by multiplying the
indent value of each link by the node level (
$node.level * indent
). In this way, level 1
links are indented 20 pixels, level 2 links are indented 40 pixels, and so forth. The final
navigation menu, with indents, might look something like:
Generating Node Children Numbers
To generate the number of children that each node has in the site structure, include the
$node.children
data macro field. If the node has no children,
$node.children
returns
0
. Using the
$node.children
macro, you can define unique behavior or look and feel for
navigation links that do and do not have children, or for navigation links with different
numbers of children.
For example, you can define logic which states that if
$node.children
is equal to
0
, then
the navigation link associated with that node will have no additional links embedded
beneath it. If, however,
$node.children
is greater than
0
, you can define logic that will
display an arrow or other graphic that illustrates the node's relationship to other
navigation links, or build a menu that displays sub-links only when a site visitor hovers on
or clicks a node which has 1 or more children.
For example, the following site structure section has one top level node called Index, with
2 children nodes (in level 2 of the structure) called Local Offices and Find an Agent:
Vue de la page 98
1 2 ... 94 95 96 97 98 99 100 101 102 103 104 ... 141 142

Commentaires sur ces manuels

Pas de commentaire