{"action":"created","issue":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1675","repository_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1675/labels{/name}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1675/comments","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1675/events","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1675","id":159843729,"number":1675,"title":"Feature: Query content view controller","user":{"login":"bdunogier","id":235928,"avatar_url":"https://avatars.githubusercontent.com/u/235928?v=3","gravatar_id":"","url":"https://api.github.com/users/bdunogier","html_url":"https://github.com/bdunogier","followers_url":"https://api.github.com/users/bdunogier/followers","following_url":"https://api.github.com/users/bdunogier/following{/other_user}","gists_url":"https://api.github.com/users/bdunogier/gists{/gist_id}","starred_url":"https://api.github.com/users/bdunogier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdunogier/subscriptions","organizations_url":"https://api.github.com/users/bdunogier/orgs","repos_url":"https://api.github.com/users/bdunogier/repos","events_url":"https://api.github.com/users/bdunogier/events{/privacy}","received_events_url":"https://api.github.com/users/bdunogier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-12T19:35:32Z","updated_at":"2016-06-13T07:28:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1675","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1675","diff_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1675.diff","patch_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1675.patch"},"body":"> Implements [EZP-24624](https://jira.ez.no/browse/EZP-24624)\r\n> Reopening of #1473 & #1460 \r\n> [Specification document](https://github.com/ezsystems/ezpublish-kernel/blob/feature-query_type_content_view_controller-ezp24258/doc/specifications/query_controller/query_controller.md) (mostly working examples)\r\n\r\nIn this approach, a built-in `QueryController` is added. It can be used in any `content_view` config to add the results of a `QueryType` to the view:\r\n\r\n```yaml\r\nsystem:\r\n    default:\r\n        location_view:\r\n            full:\r\n                folder:\r\n                    match:\r\n                        Identifier\\ContentType: 'folder'\r\n                    controller: 'ez_query:contentQueryAction'\r\n                    template: 'eZDemoBundle:full:blog.html.twig'\r\n                    params:\r\n                        query: 'LocationChildren'\r\n                        queryParameters:\r\n                            blogPathString: @=location.pathString\r\n                        variable: children\r\n```\r\n\r\nThe view is configured to use `ez_query:contentQueryAction`. The controller action runs the QueryType specified as `query`, and sets the results to the variable specified as `variable`.\r\n\r\nThe elements from `queryParameters` are passed to the QueryType's `getQuery()` method.\r\nThe expression language can be used in any queryParameter by prefixing the value with `@=`. The expression is given the `view`, the `location` and the `content`. This makes it easy to pass any property from those value objects to generate the query.\r\n\r\nA working configuration example, with a QueryType, can be found in the [specification document](https://github.com/ezsystems/ezpublish-kernel/blob/feature-query_type_content_view_controller-ezp24258/doc/specifications/query_controller/query_controller.md)."},"comment":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments/225507084","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1675#issuecomment-225507084","issue_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1675","id":225507084,"user":{"login":"bdunogier","id":235928,"avatar_url":"https://avatars.githubusercontent.com/u/235928?v=3","gravatar_id":"","url":"https://api.github.com/users/bdunogier","html_url":"https://github.com/bdunogier","followers_url":"https://api.github.com/users/bdunogier/followers","following_url":"https://api.github.com/users/bdunogier/following{/other_user}","gists_url":"https://api.github.com/users/bdunogier/gists{/gist_id}","starred_url":"https://api.github.com/users/bdunogier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdunogier/subscriptions","organizations_url":"https://api.github.com/users/bdunogier/orgs","repos_url":"https://api.github.com/users/bdunogier/repos","events_url":"https://api.github.com/users/bdunogier/events{/privacy}","received_events_url":"https://api.github.com/users/bdunogier/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T07:28:27Z","updated_at":"2016-06-13T07:28:27Z","body":"It should have been quoted, I'll fix the example. So the answer is \"yes\" :-)"}}
{"actor":{"display_login":"bdunogier"}}