Sorry, this page is only available in one language

JumpToPage

Suggested dropletname: JumpToPage

Published by: rsmith

Create a Dropdown box of selected page titles and 'Jump To' that page when selected

global $database, $wb;
$pages=explode(",",$page);
reset($pages);
array_unshift($pages," ");
$jumpto='
  <form name="jump2all">
    <select name="select" onchange="javascript: window.location = this.options[this.selectedIndex].value;">
    <option value="" selected="">Pick A  Page</option>';

while($pageid=next($pages)){
  $get_content = $database->query("SELECT page_title FROM ".TABLE_PREFIX."pages WHERE page_id = '$pageid'");
  $fetch_content = $get_content->fetchRow();
  $jumpto=$jumpto.'<option value="[wblink'.$pageid.']">'.$fetch_content['page_title'].'</option>';
}
$jumpto=$jumpto.'</select></form>';
$wb->preprocess($jumpto);
return $jumpto;

Usage:

[[JumpToPage?page=32,178,33,34,35,45,36,37,44]]



« Previous droplet | Overview | Next droplet »