How can I show only "read more" link just in node teaser, and remove or unset other links like "add new comments" or "2 Comments" at the end of a node teaser?

Comments

Jeff Burnz’s picture

Shift focus from node template to links.html.twig, there you have access to an items array and can limit what is printed in a suggestion, e.g. links--node.html.twig, also you can use the preprocess function to set up new variables, or a module to generate only the links you want, e.g. for things like number of views.

I don't have time to write code to show you how to do this etc, perhaps someone else has some time to help you further.

toto21’s picture

<a href="{{ url }}">read more</a>

illutek’s picture

a disadvantage of simple use, the 'read more' text is not language dependent.

<a href="{{ url }}">{{ "read more"|t }}

the t filter is also not a solution, all suggestions are more than welcome.