XoopsCore25 icon indicating copy to clipboard operation
XoopsCore25 copied to clipboard

Problem with pagination with Bootstrap 4 templates (xSwatch4 theme)

Open alain01 opened this issue 3 years ago • 7 comments

Hi, This issue is for discussion on the way to solve the problem. Different solution, different ways...

1 - The problem

Capture d’écran 2021-12-20 102056

No problem with default theme or xbootstrap (bt3 theme) : Capture d’écran 2021-12-20 104627 Capture d’écran 2021-12-20 104958

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. Capture d’écran 2021-12-20 122149 Capture d’écran 2021-12-20 122215 Capture d’écran 2021-12-20 122229 I like when the navigation page uses a fixed width and the position of each element doesn't move, Fixed is: Capture d’écran 2021-12-20 122219 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

alain01 avatar Dec 20 '21 11:12 alain01

I thought problems like this are why system_pagenav.tpl was introduced?

geekwright avatar Dec 20 '21 22:12 geekwright

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}&amp;catid={$catid}");
    $pagenav = $nav->renderNav(4);
} else {
    $pagenav = '';
}

alain01 avatar Dec 20 '21 22:12 alain01

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;
;} 

Capture d’écran 2021-12-21 000235

It seems it works but not very fine, no ?

alain01 avatar Dec 20 '21 23:12 alain01

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?

geekwright avatar Mar 27 '22 23:03 geekwright

@alain01 Is it still an issue? If not, could you close it?

mambax7 avatar Nov 04 '23 22:11 mambax7

Waouuu, old subject. So I need to test again.

alain01 avatar Nov 05 '23 07:11 alain01

@alain01 Any updates from your testing?

mambax7 avatar Nov 24 '23 17:11 mambax7