public function MenuChildren::filterChildrenNodeByParent in Views Menu Node Children Filter 8
Same name and namespace in other branches
- 8.2 src/Plugin/views/argument/MenuChildren.php \Drupal\views_menu_children_filter\Plugin\views\argument\MenuChildren::filterChildrenNodeByParent()
- 3.0.x src/Plugin/views/argument/MenuChildren.php \Drupal\views_menu_children_filter\Plugin\views\argument\MenuChildren::filterChildrenNodeByParent()
Filter results to child nodes of a MenuLink found by the $parent_page_identifier.
Parameters
\Drupal\views\Plugin\views\query\Sql $query:
string $parent_page_identifier String representation of a parent: node to lookup. This could be a node ID or a relative URL to a parent page.
array $menus The menu names to constrain the results to.:
1 call to MenuChildren::filterChildrenNodeByParent()
- MenuChildren::query in src/
Plugin/ views/ argument/ MenuChildren.php - Set up the query for this argument.
File
- src/
Plugin/ views/ argument/ MenuChildren.php, line 120
Class
- MenuChildren
- A filter to show menu children of a parent menu item
Namespace
Drupal\views_menu_children_filter\Plugin\views\argumentCode
public function filterChildrenNodeByParent(Sql $query, $parent_page_identifier, array $menus) {
$url = self::getUrlFromFilterInput($parent_page_identifier);
$link = $this
->getMenuLinkFromTargetUrl($menus, $url);
self::filterByPage($query, $link);
}