I tried searching for this, but nothing was exactly what I needed. I need to be able to put a link in the primary navigation menu that links to the latest "issue" of a magazine. Basically the node with the latest creation time. I'm using book to organize nodes into volumes, issues, and articles. Any thoughts? I thought about using Views to create the view, but if I could just link to the node itself it would be much better. Thanks!

Comments

yelvington’s picture

You're on the right track. Make a view that displays a page at something like /latest-issue. Link to the view.

The view should return only one result, the most recent item.

Rewrite the returned data (you can do this through the UI) to call http://api.drupal.org/api/function/drupal_goto with the correct path to the found node. This requires a tiny bit of PHP, but it's trivial.

soundboy89’s picture

This is just what I need, but how do I rewrite the returned data? I have a view that returns the nid that I want, and all I need to do is call drupal_goto(node/[nid]) but the "Rewrite output" option in the Views field settings doesn't allow php.

soundboy89’s picture

I solved it, thanks!

jmcerda’s picture

How did you manage this?