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

pat-inject: method to modify the inserted snippet #989

Open
agitator opened this issue Apr 5, 2022 · 1 comment
Open

pat-inject: method to modify the inserted snippet #989

agitator opened this issue Apr 5, 2022 · 1 comment

Comments

@agitator
Copy link

agitator commented Apr 5, 2022

For a load more functionality, I'd like to keep the original batch next link in the template and only add'?ajax_load=1' to the target element.

Something like this append_to_selector_in_target [.next-link, '?ajax_load=1']

Or is there a way for this already?

@thet
Copy link
Member

thet commented Apr 6, 2022

something like: <a href="./@@batch?start-at=10&batch_size=10" class="pat-inject" data-pat-inject="source: ...; target: ...; url: ./@@batch?start-at=10&batch_size=10&ajax_load=1">load more...</a> ?

You place the "load more..." button at the end of the document and replace itself with the results from the server - which itself again includes the new "load more" button, which will again placed at the end of the document.

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

2 participants