diff --git a/app/config/views.yml b/app/config/views.yml index 36fe5437..1e6560c8 100644 --- a/app/config/views.yml +++ b/app/config/views.yml @@ -102,6 +102,7 @@ ezpublish: query_type: "AppBundle:Children" parameters: parent_location_id: '@=location.id' + included_content_type_identifier: 'product' assign_results_to: children template: "@ezdesign/full/product_list.html.twig" match: diff --git a/src/AppBundle/QueryType/ChildrenQueryType.php b/src/AppBundle/QueryType/ChildrenQueryType.php index 20ae6827..bba4fb6d 100644 --- a/src/AppBundle/QueryType/ChildrenQueryType.php +++ b/src/AppBundle/QueryType/ChildrenQueryType.php @@ -22,6 +22,10 @@ public function getQuery(array $parameters = []) $criteria[] = new Query\Criterion\MatchNone(); } + if (!empty($parameters['included_content_type_identifier'])) { + $criteria[] = new Query\Criterion\ContentTypeIdentifier($parameters['included_content_type_identifier']); + } + $options['filter'] = new Query\Criterion\LogicalAnd($criteria); if (isset($parameters['limit'])) {