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 default the statistics module shows "xx reads" below a node when it's enabled. I think "views" would be a better term these days.
For reference, anyone wanting to change that right now can add this code to the THEME_preprocess_node() function in template.php:
$content['links']['statistics']['#links']['statistics_counter']['title'] = str_replace('reads', 'views', $content['links']['statistics']['#links']['statistics_counter']['title']);
Comment | File | Size | Author |
---|---|---|---|
#4 | statistics-views-1418008-4.patch | 2.14 KB | timmillwood |
#1 | statistics-views-1418008-1.patch | 794 bytes | timmillwood |
Comments
Comment #1
timmillwoodHere's a patch for this if anyone wishes to review.
Comment #2
droplet CreditAttribution: droplet commentedComment #4
timmillwoodFixed the tests
Comment #5
yoroy CreditAttribution: yoroy commentedI agree that 'views' is a better word here.
Comment #6
catchMakes sense to me. Committed/pushed to 8.x, thanks!
Comment #8
smartsystems160 CreditAttribution: smartsystems160 commented$content['links']['statistics']['#links']['statistics_counter']['title'] = str_replace('reads', 'views', $content['links']['statistics']['#links']['statistics_counter']['title']);
Code above didnt work for me (Drupal 7), so i used the built-in strings override function in my settings.php file to override it by adding the following:
'@count reads' => '@count views',
'1 read' => '1 view',
Comment #9
jboyette36 CreditAttribution: jboyette36 commentedSlight adjustment to the code at the top that works for me on a current D7 site.