function seven_preprocess_node_add_list in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/themes/seven/seven.theme \seven_preprocess_node_add_list()
Implements hook_preprocess_HOOK() for list of available node type templates.
File
- core/
themes/ seven/ seven.theme, line 59 - Functions to support theming in the Seven theme.
Code
function seven_preprocess_node_add_list(&$variables) {
if (!empty($variables['content'])) {
/** @var \Drupal\node\NodeTypeInterface $type */
foreach ($variables['content'] as $type) {
$variables['types'][$type
->id()]['label'] = $type
->label();
$variables['types'][$type
->id()]['url'] = \Drupal::url('node.add', array(
'node_type' => $type
->id(),
));
}
}
}