Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow views contextual filters to get passed to the view trough the views endpoint #26

Closed
robertgarrigos opened this issue Jul 23, 2019 · 2 comments

Comments

@robertgarrigos
Copy link
Member

Right now, we can only pass an argument trough the views filter criteria, not the contextual filters, as the latest don't get passed to the view. But the fix is quite straightforward. I'll file a PR for this. And it's not intrusive with actual behaviour.

robertgarrigos added a commit that referenced this issue Jul 23, 2019
It allows to pass views contextual filters as path arguments. This is, you could filter posts by tid (which needs to be done through contextual filters - exposed filters only allow to filter by term name) by adding a contextual filter to the view. Then you can just add the tid to the endpoint like this:

```
/api/v2/views/posts/page/12?page=1
```
This will show the posts which have the term id 12.

This is for the views v2 end point only.
@robertgarrigos
Copy link
Member Author

PR done: #27

@robertgarrigos robertgarrigos changed the title Allow views contextual filters to pass to the view Allow views contextual filters to get passed to the view in the views endpoint Jul 23, 2019
@robertgarrigos robertgarrigos changed the title Allow views contextual filters to get passed to the view in the views endpoint Allow views contextual filters to get passed to the view trough the views endpoint Jul 23, 2019
@robertgarrigos
Copy link
Member Author

Fixed

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant