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

Prevent Show More button from opening a new window with Twitter style pagination #125

Open
mtully-blitz opened this issue Sep 7, 2018 · 0 comments

Comments

@mtully-blitz
Copy link

I noticed in our site logs that traffic was going to the ajax view that handles the pagination page view ("/news/home-articles/page/?page=2"). I was able to recreate myself by right clicking the load more link and selecting open in new tab. I also suspect that the bots crawling the site might be generating this traffic too.

Calling preventDefault() in the JS click event might do the trick and would be easiest fix, but I'm not sure if that would handle the bots.

A more involved and perhaps better long term approach is to update the JS code to be more markup agnostic and replace the with a or and moving the page url from href to data-page-url or something like that. Right now it's tied to there being an href attribute, which means it's gotta be an . This limits what changes people can make to the template and might have unintended consequences with indexing bots.

I will try to make a PR with the proposed solution for this when I have the time. Thanks for the great project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant