XoopsCore25
XoopsCore25 copied to clipboard
Problem with pagination with Bootstrap 4 templates (xSwatch4 theme)
Hi, This issue is for discussion on the way to solve the problem. Different solution, different ways...
1 - The problem
No problem with default theme or xbootstrap (bt3 theme) :
2 - The code
File /class/pagnav.php, function public function renderNav($offset = 4) line 89 and 93 $ret .= '... '; This text doesnt' use class.!
3a - Solution A
New function on pagnav.php, for example, renderNavBT Then I can add a new class like: $ret .= '<span class="xo-nocounterpage>"...';
Then I add a class in the /themes/xswatch4/style.css to solve the problem with a margin space in the x axe.
3b - Solution B
I add this class directly on the renderNav original function. This class is not defined by default in xoops so, for bt3 or default theme, it would be ok BUT we are not safe from a side effect if webmasters have defined this class in their custom css file
3c - Solution C
May be the css file for Xswatch 4 would be reworked ? If Yes, I should investigate on it...
3d - Other solution ?
Please, thank you for suggesting !
4 - New cosmetic design
It would be anither subject but it concerns the navigation page
I hate that the navigation page moves depending the position of the page.
I hate that the buttons "«" and "»" disappear.
I like when the navigation page uses a fixed width and the position of each element doesn't move,
Fixed is:
I want Same width for all buttons, so no strong, no parenthesis
So I can add a new function called renderNavEqualBT for that. What do you think about that
Finally I'm not a developper so, may be there is some trouble that I dont think if I modify or add new function in the class xoops file. I need your opinion, suggestion before I will work for that.
Alain
I thought problems like this are why system_pagenav.tpl was introduced?
In the module Tag, in the /view.tag.php There is (l185)
if (!empty($start) || count($items_data) >= $limit) {
$count_item = $tagHandler->getItemCount($tagid, $modid, $catid); // Tag, modid, catid
require_once $GLOBALS['xoops']->path('/class/pagenav.php');
$nav = new \XoopsPageNav($count_item, $limit, $start, 'start', "tag={$tagid}&catid={$catid}");
$pagenav = $nav->renderNav(4);
} else {
$pagenav = '';
}
3e - A solution (not the best) without modify the /class/pagnav.php
in the file /style.css, in xswatch4 theme :
#xo-pagenav{ display: inline-block;text-align:left }
become
#xo-pagenav{ display: flex;text-align:left }
and
/* in-active */
#xo-pagenav a.xo-counterpage {margin-right: -9px;background-color: #f8f8f8;color: #999999;border: 1px solid #dfdfdf;}
become
/* in-active */
#xo-pagenav a.xo-counterpage {margin-right: -9px;background-color: #f8f8f8;color: #999999;border: 1px solid #dfdfdf;
margin: 0 0;
;}
It seems it works but not very fine, no ?
To restate my question, there exists a htdocs/modules/system/templates/system_pagenav.tpl template that can be overridden in every theme (In fact it is.)
What additional information needs to be assigned for the templates for you to be able to make it do what you want?
@alain01 Is it still an issue? If not, could you close it?
Waouuu, old subject. So I need to test again.
@alain01 Any updates from your testing?