Link to latest poll? I set up my poll tpl file to include the poll fields (form, results, etc) along with a list at the bottom for the previous polls, ordered by date.  What I am trying to do is, from the main menu, link to the latest poll.  In other words, my current latest poll is node/123456/.  I can link to that, obviously.  But when we create a new one, that link needs to be updated.  I'd love to have it so the menu item doesn't need to be edited each time a new poll is created.

Any ideas?

UPDATE

Just so you don't think I'm waiting expecting you to write it for me - this is where I am:


$items['poll/latest'] = array(
    'title' => 'Latest Poll',
    'page callback' => 'latest_poll_find_poll',
    'access callback' => TRUE,
    'type' => MENU_NORMAL_ITEM,
  );

return $items;

/**
 * Find latest poll and redirect user
 */
function latest_poll_find_poll() {
  $nid = db_query('SELECT MAX(nid) AS nid FROM {node} WHERE type = "poll"')->fetchField();
  $latest = is_numeric($nid) ? 'node/' . $nid : '';
  drupal_goto($latest);
}
Create a small custom module that implements hook_menu() and a custom callback that determines the latest poll and redirects the user.  Something like this perhaps (for D6, D7 will be similar):  

Drupal 7



MYMODULE.info

name = "MYMODULE"
description = "Adds a menu item for the most recent poll"
core = 7.x


MYMODULE.module

&lt;?php
/**
 * Implementation of hook_menu()
 */
function MYMODULE_menu() {
  $items = array();

  $items['poll/latest'] = array(
    'title' =&gt; 'Latest Poll',
    'page callback' =&gt; 'MYMODULE_find_poll',
    'access callback' =&gt; TRUE,
    'type' =&gt; MENU_NORMAL_ITEM,
  );

  return $items;
}

/**
 * Find latest poll and redirect user
 */
function MYMODULE_find_poll() {
  $nid = db_query('SELECT MAX(nid) AS nid FROM {node} WHERE type = :type', array(':type' =&gt; 'poll'))-&gt;fetchField();
  $latest = is_numeric($nid) ? 'node/' . $nid : '&lt;front&gt;';
  drupal_goto($latest);
}


Drupal 6  



MYMODULE.info  

name = "MYMODULE"
description = "Adds a menu item for the most recent poll"
core = 6.x


MYMODULE.module  

&lt;?php
/**
 * Implementation of hook_menu()
 */
function MYMODULE_menu() {
  $items = array();

  $items['poll/latest'] = array(
    'title' =&gt; 'Latest Poll',
    'page callback' =&gt; 'MYMODULE_find_poll',
    'access callback' =&gt; TRUE,
    'type' =&gt; MENU_NORMAL_ITEM,
  );

  return $items;
}

/**
 * Find latest poll and redirect user
 */
function MYMODULE_find_poll() {
  $nid = db_result(db_query('SELECT MAX(nid) AS nid FROM {node} WHERE type = "poll"'));
  $latest = is_numeric($nid) ? 'node/' . $nid : '&lt;front&gt;';
  drupal_goto($latest);
}


Replacing "MYMODULE" with the name of your custom module and placing those files in your site's modules directory in a folder named MYMODULE (replace of course).