Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zca_split_page_results nested li tags #179

Open
dennisns7d opened this issue Dec 17, 2022 · 2 comments
Open

zca_split_page_results nested li tags #179

dennisns7d opened this issue Dec 17, 2022 · 2 comments
Labels
future consideration Identifies a potential, future change

Comments

@dennisns7d
Copy link

dennisns7d commented Dec 17, 2022

Lines 205-213 of includes/classes/zca/zca_split_page_results.php:
// next group of pages
if ($cur_window_num < $max_window_num) {
$href_link = zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type);
$link = '<li><a class="page-link" href="' . $href_link . '" title="' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . '" aria-label="' . ARIA_PAGINATION_ELLIPSIS_NEXT . '">...</a></li>';
$display_links_string .= $link;
$ul_elements .= ' <li class="ellipsis page-item">' . $link . '</li>' . "\n";
} else {
// $ul_elements .= ' <li class="ellipsis" aria-hidden="true">' . $link . '</li>' . "\n";
}
$ul_elements will contained nested <li> tags. Perhaps the <li> tag added to $link should be moved to $display_links as in the following code to avoid the nested tags:
// next group of pages
if ($cur_window_num < $max_window_num) {
$href_link = zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type);
$link = '<a class="page-link" href="' . $href_link . '" title="' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . '" aria-label="' . ARIA_PAGINATION_ELLIPSIS_NEXT . '">...</a>';
$display_links_string .= '<li>' . $link . '</li>';
$ul_elements .= ' <li class="ellipsis page-item">' . $link . '</li>' . "\n";
} else {
// $ul_elements .= ' <li class="ellipsis" aria-hidden="true">' . $link . '</li>' . "\n";
}

@lat9 lat9 added the bug Something isn't working label Dec 17, 2022
@lat9 lat9 added this to the v3.5.0 milestone Dec 17, 2022
@lat9
Copy link
Owner

lat9 commented Dec 19, 2022

I'm not able to reproduce any issue with the split page results using the demo products. I've dropped Configuration :: Maximum Values :: Products Listing from 10 to 3 and traverse the "Big Linked" category that has 25 products and I'm not seeing any HTML validation issues.

What is different in your setup?

@lat9 lat9 added question A question about the template and removed bug Something isn't working labels Dec 19, 2022
@lat9 lat9 removed this from the v3.5.0 milestone Dec 19, 2022
@dennisns7d
Copy link
Author

I submitted this issue based on code inspection.

Further investigation reveals that in the use case you're using that the display_links method is using false for the value for $outputAsUnorderedList. The value of $display_links_text is used in the return, which results in valid HTML.

Invalid HTML (nested li tags) would result only if the value of $ul_elements was used in the return. This happens only when the $outputAsUnorederedList argument is true.

Most of the calls to the display_links method use the value of $paginateAsUL for the $outputAsUnorderedList argument. Only the responsive_classic template sets this variable to true.

Consider my suggested fix as preventive medicine in case $paginateAsUL is ever set true in the future.

@lat9 lat9 added future consideration Identifies a potential, future change and removed question A question about the template labels Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future consideration Identifies a potential, future change
Projects
None yet
Development

No branches or pull requests

2 participants