Turn off "news" page views for non admins

Post

Posted
Rating:
#7338 (In Topic #1831)
Does anyone know where this is in the admin zone? I have tried every possible search string and can not find a toggle for it. Simply want to disable page views on a news article for all roles aside from admin.

Thanks in advance!

F_O

Post

Posted
Rating:
#7343
Hi,

Admin Zone > Setup > Configuration > Site options has an option called "Reveal usage figures". This is probably what you are seeking but the effect is global and not just for news.

Post

Posted
Rating:
#7344
Thanks Adam, i tried it and while it does allow forum views to still be seen, the article page views are not seen by an admin. I just don't want other roles to see them, so it won't meet the requirements. Thank you though for the feedback!

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Chris Graham)
#7345
Hi again,

To achieve what you require, create a fresh copy of NEWS_ENTRY_SCREEN.tpl in your templates_custom directory (to avoid core updates undoing your edit) then make the following change:-

Find

Code

{+START,IF,{$INLINE_STATS}}

Replace

Code

{+START,IF,{$AND,{$IS_ADMIN},{$INLINE_STATS}}}

You may need to do make this edit to any other news templates you are displaying/using (blocks, etc) if they also show the view count (not sure if any do but worth checking).
 

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Adam Edington)
#7347
That's awesome, thank you so much! Works like a champ :thumbs:
1 guest and 0 members have recently viewed this.