AnsweredAssumed Answered

I believe everything you need is already in HEAD.Here's...

Question asked by davidc on Jun 1, 2007
Latest reply on Jul 3, 2007 by davidc
I believe everything you need is already in HEAD.

Here's the full Web Script for displaying the name of the node as specified by its node reference on the url.  Add the following three files to your web scripts folder…


  <shortname>Search example</shortname>
  <description>Demonstrate use of javascript search api</description>
  <url format="html" template="/showname?noderef={noderef}"/>


// use the javascript search api to get the node for the noderef argument
var node = search.findNode(args.noderef);

// setup model for template to render
model.node_that_has_been_found = node;


     <#if node_that_has_been_found?exists>
       Name of node ${args.noderef} is ${}.
       Node ${args.noderef} does not exist.

You can then issue the URL…


for a node in your repository (use the Node Browser to get a noderef).

Basically, if you add a javascript file, it will be executed before the template.  The full javascript api is available.  You can populate the special 'model' object with named values which are then accessible in the template e.g. node_that_has_been_found in the above example.