I created a content type "Troubleshooting Options". I want to render the title of this content in a different way. To do this I overrode default field--node--title.html.twig
with field--node--title--troubleshooting-options.html.twig
(as recommended by twig debug).
I am unable to render the title
in this new template. Tried {{ content.title }}
, {{ node.title }}
, {{ node.title.value }}
but none worked. Although drupal caching is disabled I rebuilt cache every time.
Twig file name suggestions:
<!-- FILE NAME SUGGESTIONS:
* field--node--title--troubleshooting-options.html.twig
x field--node--title.html.twig
* field--node--troubleshooting-options.html.twig
* field--title.html.twig
* field--string.html.twig
* field.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/stable/templates/field/field--node--title.html.twig' -->
I am very new to Drupal.
node--[troubleshooting-options].html.twig
and then use the code provided in this answer{{ items.title.content }}
{%- for item in items -%} {{ item.title.content }} {%- endfor -%}