I would like to include some custom html code only on a specific node. I created "parts" directory and put a custom twig template in it. (mytheme/templates/parts/custom_html.html.twig)
I then copied over the page.html.twig to my templates directory, and included the custom template with:
{% include directory ~ '/templates/parts/custom_html.html.twig' %}
I want to show this only on a certain node, say "node/2". I don't wan't to create a custom template just for this page, like "page--node--2.html.twig".
Is there a way of using a condition to just show this template on the specific node?
Kind of like this?
{% if 'node/2' %}
{% include directory ~ '/templates/parts/custom_html.html.twig' %}
{% endif %}