Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Pagination for Data Embeds #630

Open
trieloff opened this issue Mar 19, 2020 · 1 comment
Open

Pagination for Data Embeds #630

trieloff opened this issue Mar 19, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@trieloff
Copy link
Contributor

pagination: for large amounts of data, it should probably somehow be possible to limit and navigate or use smart loading. uncontrollably large HTML files could also become dangerous (DOS) if we just render whatever data.

Originally posted by @rofe in #593 (comment)

@trieloff trieloff added the enhancement New feature or request label Mar 19, 2020
@trieloff
Copy link
Contributor Author

I think one part of this can be handled in the upcoming helix-data-embed (adobe/helix-home#112) service. We'd add a page and hitsPerPage URL parameter. (this would be consistent with

https://github.com/adobe/helix-shared/blob/8f4100a40d1cf0d283603a9af7ccb1438d2bdd8a/src/IndexConfig.js#L106-L111

Part two is trickier:

  • the simplest thing would be to simply pass through the page and hitsPerPage` URL parameters, no opt-out
  • with a further addition that specifying one or both parameters in the embed URL will make them non overridable

but, if you want cool AJAX-style pagination we need to do more. We could:

  • add the URL template for the data embed to the section tag as a data-hlx-data-src property
  • in addition to rendering the placeholder-filled Markdown as normal HTML, render the placeholder-containing Markdown in a HTML <template> tag at the end of the section.

That way you could build a small JS script that adds a client-side pagination component at the end of a section that allows pagination.

I'd consider this whole thing a new feature.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant