If you are writing a preprocess function, then the correct name of the function is THEMENAME_preprocess_entity_print(); replace THEMENAME with the machine name of the theme implementing it. If this is the case, what in the preprocess function you set as $vars['field_name'], where $vars is the array passed as reference to the preprocess function, it is accessible as field_name in the Twig template file. See for example template_preprocess_node() and node.html.twig: What the function sets as $variables['node'] is available as node in the template file.
You can render either the uri or text of a link field directly in the twig template. In the case of a node you can use either of the following within the twig template file (assumes the machine name of your link field is field_link):
Drupal 8 Theming With Twig Pdf 40
Download Zip: https://shoxet.com/2vKL2a
2ff7e9595c
Comments