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

How to remove page query parameter from first page? #804

Closed
scion4581 opened this issue Aug 20, 2024 · 1 comment · Fixed by #809
Closed

How to remove page query parameter from first page? #804

scion4581 opened this issue Aug 20, 2024 · 1 comment · Fixed by #809
Labels

Comments

@scion4581
Copy link

|---------------- | ------
| Bundle version | 6.4.0
| Symfony version | 6.4.10
| PHP version | 8.2.2

Support Question

Hi! I can't understand how to remove page query param automatically when it equal 1

For example, https://example.com/posts and https://example.com/posts?page=1 same pages and I need to remove the parameter page making the first page always without page param

Maybe I miss some configuration for this case?

Thanks

@garak
Copy link
Collaborator

garak commented Aug 23, 2024

That is not implemented currently.
Here's an idea for a possible improvement: we could add a new Twig function (or filter) taking the page number as an argument and returning the same page number, unless the number is 1 (if so, null should be returned).
Then we can use such new function/filter to build the links in our templates.

Probably this would require a new option (and so being disabled by default), to keep BC

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

Successfully merging a pull request may close this issue.

2 participants