Score:2

How to get content url in views-view-unformatted block template

mx flag

In Drupal 8, I created template for solr search view views-view-unformatted--solr_search_content--block.html.twig

I am trying to print the content link by {{ row.content['#view'].style_plugin.render_tokens[ loop.index0 ]['{{ title }}'] }}

But displayed title with link. I need link only, Any Idea!

{% for row in rows %}
<div class="row block p-5">      
    <div class="views-row">
      {{- row.content -}}
    </div>      
    <div class="col-2 text-center chevron-right my-auto">
      <a href="{{ row.content['#view'].style_plugin.render_tokens[ loop.index0 ]['{{ title }}'] }}">
      <i class="fal fa-chevron-right"></i></a>
    </div>
</div>
{% endfor %}
sonfd avatar
in flag
Can you add a content url field to your view's fields in the UI and then render that?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.