Node navigator code snippet

Create a new block or page with Full HTML input format access. The following javascript will redirect you to the node number without having to highlight just the right part of the URL.

Enter a node number in the box below. Clicking Submit will redirect you to it.

<script type="text/javascript">
function handleThis(formElm)
{
window.location="/node/" + formElm.nid.value + "";
return false;
}
</script>
<form onsubmit="return handleThis(this)">
<input type="text" name="nid" />
<input type="submit" value="Submit" />
</form>

Depending on your site configuration, you might need to alter the window.location value for not redirecting directly to the root of the URL, in which case an absolute URL might work best.


» deekayen's blog · Printer-friendly version Topics:

Is it possible to use Node:

Is it possible to use Node: Menu Title as a field in Views 2? This is generally a shorter title and better suited to the list I'm trying to create, but I don't see the field to pick on the list... Thanks!

reply

Post new comment

  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <hr /> <a> <p> <em> <strong> <cite> <code> <blockquote> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.