Extra Block Types (EBT) - New Layout Builder experience❗
Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.
❗Extra Paragraph Types (EPT) - New Paragraphs experience
Extra Paragraph Types (EPT) - analogical paragraph based set of modules.
GLightbox is a pure javascript lightbox (Colorbox alternative without jQuery)❗
It can display images, iframes, inline content and videos with optional autoplay for YouTube, Vimeo and even self-hosted videos.
Hide the comment field
Good day!
I need to hide a specific comment field from all users except the node author.
The idea is as follows: User1 creates a certain content type Article, and a separate comment type with a set of fields is created for this content type. Other users write comments on this content, filling in several fields. When viewing comments on the content created by User1, only User1 sees all the comment fields, while the other users see all fields except "field_example".
I overrode the comment.html.twig template.
I'm trying to add this condition:
{% if node.author_name = user.username %}
{{ content }}
{% else %}
{{ content|without('field_example') }}
{% endif %}
But it throws an error.
Please advise what I’m doing wrong!
Thanks a lot in advance!
- Log in to post comments