I wanted to rename "Read more" in teaser (node--blog--teaser.html.twig) to something like "Continue" or anything else.
How can I achieve this?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI wanted to rename "Read more" in teaser (node--blog--teaser.html.twig) to something like "Continue" or anything else.
How can I achieve this?
In your theme open file THEMENAME.theme, example in my case THEMENAME is bartik and file is bartik.theme add code below:
/**
* Implements hook_preprocess_links().
*/
function bartik_preprocess_links(&$variables) {
if (isset($variables['links']['node-readmore'])) {
$variables['links']['node-readmore']['link']['#title'] = t('Read more custom text');
}
}
Clear all cache and see result.
About add custom class to readmore link you can check here: Add custom classes to node links