template_preprocess_node_add_list(&$variables)
Prepares variables for list of available node type templates.
Default template: node-add-list.html.twig.
array $variables: An associative array containing:
node_add_page()
function template_preprocess_node_add_list(&$variables) { $variables['types'] = array(); if (!empty($variables['content'])) { foreach ($variables['content'] as $type) { $variables['types'][$type->id()] = array( 'type' => $type->id(), 'add_link' => \Drupal::l($type->label(), new Url('node.add', array('node_type' => $type->id()))), 'description' => array( '#markup' => $type->getDescription(), ), ); } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!node!node.module/function/template_preprocess_node_add_list/8.1.x