Skip to content

Instantly share code, notes, and snippets.

@jenlampton
Last active December 17, 2015 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenlampton/5650953 to your computer and use it in GitHub Desktop.
Save jenlampton/5650953 to your computer and use it in GitHub Desktop.
New comment template (and variables) for Twig in D8
<article{{ attributes }}>
{{ title.prefix }}
{% if new %}
<mark class="new">{{ new }}</mark>
{% endif %}
<h3{{ title.attributes }}>{{ title.label }}</h3>
{{ title.suffix }}
<footer>
{{ author }}
<p class="submitted">
{% trans %}
Submitted by {{ author.name }} on {{ published_date }}
{% endtrans %}
</p>
{#
Indicate the semantic relationship between parent and child comments
for accessibility. The list is difficult to navigate in a screen reader
without this information.
#}
{% if parent %}
<p class="parent element-invisible">{{ parent }}</p>
{% endif %}
{{ permalink }}
</footer>
<div{{ content.attributes }}>
{{ content.remainder }}
{% if author.signature %}
<div class="user-signature">
{{ author.signature }}
</div>
{% endif %}
</div>
{{ links }}
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment