New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show headlines in article teasers again #7026
Conversation
But this is not the case with all the other templates I think. Can we instead just set the {% set headline = { tag_name: 'h1', text: article.title } %} |
It's not the case because this template renders the headline based on the article title and doesn't work like all the other content elements. If it would have worked, it would have thrown an error due to text not existing :) |
IMHO the correct fix is to add |
@m-vo @ausi I was confused about your approach first but you are totally right. However, changing it to {% trans_default_domain "contao_default" %}
{% extends "@Contao/content_element/_base.html.twig" %}
{% use "@Contao/component/_read_more.html.twig" %}
{% set headline = {tag_name: 'h1', text: article.title} %}
{% block content %}
{% block teaser %}
{{ article.teaser|default|insert_tag|raw }}
{% endblock %}
{% block link %}
{% with {title: 'MSC.readMore'|trans([article.title])} %}
{{ block('read_more_component') }}
{% endwith %}
{% endblock %}
{% endblock %} also needs the updated tests in a5febfd because previously it didn't test the headline at all. |
Thank you @zoglo. |
Fixes #7025
unit
has to betag_name
to work with _headlinecontao/core-bundle/contao/templates/twig/component/_headline.html.twig
Line 20 in da1b9ea
value
has to betext
to work with _headlinecontao/core-bundle/contao/templates/twig/component/_headline.html.twig
Line 24 in da1b9ea