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

Use query.perPage to set maxContentItems #14

Closed
s3rgiosan opened this issue Mar 13, 2024 · 3 comments
Closed

Use query.perPage to set maxContentItems #14

s3rgiosan opened this issue Mar 13, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@s3rgiosan
Copy link
Contributor

Hi @psorensen,

We have this use case where we want to be able to set the number of items an editor can manually select.
What do you think of using the Query Loop posts per page setting to define the ContentPicker's maxContentItems?

https://github.com/psorensen/curated-query-loop/blob/main/assets/js/admin/block-extension.js#L30

maxContentItems={query.perPage || 10}
@psorensen
Copy link
Owner

Great idea! Worth noting that this wouldn't be a strict guardrail for the editor - i.e. the editor can adjust the posts-per-page attribute. That said, I can definitely see the value in this when establishing patterns using this block.

@s3rgiosan
Copy link
Contributor Author

I've opened a PR with this change #16

@psorensen
Copy link
Owner

closed via #16

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

No branches or pull requests

2 participants