2

I like to customize the output of SUBMITTED BY, e.g. I like to change it to WRITTEN BY.
Where can I do it? Thanks for help

3

I think you need specifically for ARTICLE Type, just do apply change in node.html.twig template file(Here I am referring Bartik theme's node.html.twig for common understanding) as shown below. So for all other content type it will be Submitted by and for Articles it will be Written By,

Original code in node.html.twig,

    <span{{ author_attributes }}>
      {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
    </span>

Replace it with,

    {% if node.getType() == 'article' %}
       <span{{ author_attributes }}>
         {% trans %}Written by {{ author_name }} on {{ date }}{% endtrans %}
       </span>
    {% else %}
       <span{{ author_attributes }}>
         {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
       </span>
    {% endif %}
| improve this answer | |
5

In node.html.twig change the line SUBMITTED BY to WRITTEN BY

  {% if display_submitted %}
    <footer class="node__meta">
      {{ author_picture }}
      <div{{ author_attributes.addClass('node__submitted') }}>
        {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
        {{ metadata }}
      </div>
    </footer>
  {% endif %}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.