-4

I'm styling a listing page for content marked with a certain content keyword (taxonomy term). I already have a views-view-unformatted--taxonomy-term--content-keyword.html.twig file to display the fields. I'm in the process of creating node--view-taxonomy-term.html.twig, but upon early testing, the content.body field is displaying the inline css code.

I want to create a page view, but it requires me to specify a url. I'm trying to make this work for all content marked with content keywords.

sample code from views-view-unformatted--taxonomy-term--content-keyword.html.twig

{% for row in rows %}
  {%
    set row_classes = [
    'cell',
    'tags-listing--item',
  ]
  %}
  <div{{ row.attributes.addClass(row_classes) }}>
    {{- row.content -}}
  </div>
{% endfor %}

and then sample code for node--view--taxonomy-term.html.twig

<div class="cell auto">
  <h3><a  href="{{- goto_url -}}">{{ label }} </a></h3>
  <div class="">{{ content.body }}</div>
</div>

Your Answer

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

Browse other questions tagged or ask your own question.