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

Add page number parameter to the search url #8

Open
Natkeeran opened this issue Feb 27, 2024 · 1 comment
Open

Add page number parameter to the search url #8

Natkeeran opened this issue Feb 27, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@Natkeeran
Copy link

When clicking on a search result for a collection or global search, then clicking on a page, it loads as expected.

However, the page number is not added to the search parameter. Thus, the use cannot click and share the link to go to that page.

https://menus.digital.utsc.utoronto.ca/61220/utsc73546?page=8

@kylehuynh205 kylehuynh205 transferred this issue from digitalutsc/islandora_lite_docs Apr 18, 2024
@kylehuynh205 kylehuynh205 added the good first issue Good for newcomers label Apr 18, 2024
@gerbie-goober
Copy link

gerbie-goober commented Apr 26, 2024

  • AJAX related issue
  • Refer here:
    // Update items_per_page links in pager
    if (url.indexOf("items_per_page=") == -1) {
    // append items_per_page
    $("a.pager__itemsperpage").each(function( index ) {
    var newUrl = url + "&items_per_page=" + $(this).html();
    $(this).attr("href", newUrl);
    });
    }
    else {
    // replace existed items_per_page
    var params = parseQueryString(url.split("?")[1]);
    var newParams = [];
    var existingDateQuery = false; // true if a date query already exists
    var links = {};
    // update publication date in url if previously queried
    for (var key in params) {
    if (!params[key]) { // no search parameters in url
    break;
    }
    // check for items_per_page query
    if (!key.startsWith("items_per_page")) {
    newParams.push(key + "=" + params[key]);
    }
    }
    var newParamsUrl = newParams.join('&');
    $("a.pager__itemsperpage").each(function( index ) {
    $(this).attr("href", url.split("?")[0] + '?' + newParamsUrl + "&items_per_page=" + $(this).html());
    });
    }
    • there seems to be support for items_per_page links, but no support for page_item (the class name for the page links)
  • Hypothesis: there is a missing block for managing/updating the page_links supposedly on reload or loading
  • Note: once a page link is clicked, the href is no longer available for that page_item
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Backlog
Development

No branches or pull requests

3 participants