Hi, im using XOOPS 2.0.14 and smartsection 2.1 and i was wondering if i can use the navigational dropdown list feature of the pagenav XOOPS class but using names instead of numbers. Im think of use something like pagebreak=name1 or pagebreak name=name1. So i generate a dropdown menu with names.
try to explain.
The code of item.php of /modules/smartsection create an instance of the object pagenav like this
if ($itemObj->pagescount() > 0) {
include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
if ($item_page_id == -1) ($item_page_id = 0);
$pagenav = new XoopsPageNav($itemObj->pagescount(), 1, $item_page_id, 'page', 'itemid=' . $itemObj->itemid());
$xoopsTpl->assign('pagenav', $pagenav->renderNav());
}
To show the navigational numbers of pagination uses the rendernav function
$xoopsTpl->assign('pagenav', $pagenav->renderNav());
I check the pagenav class under /class/pagenav and see this method inside the class
function renderSelect($showbutton = false)
{
if ( $this->total < $this->perpage ) {
return;
}
$total_pages = ceil($this->total / $this->perpage);
$ret = '';
if ( $total_pages > 1 ) {
$ret = ';
$ret .= ';
$counter = 1;
$current_page = intval(floor(($this->current + $this->perpage) / $this->perpage));
while ( $counter <= $total_pages ) {
if ( $counter == $current_page ) {
$ret .= '';
} else {
$ret .= '';
}
$counter++;
}
$ret .= '';
if ($showbutton) {
$ret .= ' ._GO.'" />';
}
$ret .= '';
}
return $ret;
}
So to use the dropdown only have to chage this line on item.php
$xoopsTpl->assign('pagenav', $pagenav->[b]renderSelect()[/b]);
to use this function of the pagenav class.
But i want to generate a select box with names!
This code generates a dropdown with numbers..
But i want to generate a select box with names!
(example: 1.- Introduction, 2.- First Impression.. etc)
but dont know how the xoopscode "pagebrek" works so i dont know how to try to write some code to capture those pagebreaks names and generate the dropdown.
Ta in advance