Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By unknownuser221 on
In drupal 8 when creating a view for taxonomy terms and add a field I enabled
Link to the Taxonomy term
option. The pathauto module is enabled so it gives following link:
<a href="/site/taxonomy/taxonomy-term" hreflang="en">Taxonomy Term</a>
But I want something like this:
<a href="/site/taxonomy/taxonomy-term" hreflang="en">Read More</a>
I have created a twig file views-view-field--my-region--name.html.twig
as following:
{{ output -}}
I cannot go into more deeper with this setup. Can you help me to change the anchor text OR just get the taxonomy term url?
Comments
Add new field in your
Add new field in your taxonomy term view called 'Link to Taxonomy term'. In configuration add 'Text to Display' value as 'Read More' in given input text-field and save the field settings and view.
This will show the 'Read More' text with taxonomy term link.
Thanks,
Please explain more
Sorry, but there is no field for value 'Text to Display'. Please can you explain more?
In field configuration pop-up
In field configuration pop-up there are options like:-
Create a label - checkbox
Place a colon after the label - checkbox
Exclude from display - checkbox
Text to display - Input field
Make sure that you have added link field to configure this.
Thanks,