Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
iJeff Posted September 2, 2018 Posted September 2, 2018 IPS Page. How to get number of views on individual entry  apparently this control the page views in listing .... i have been tinkering with it.. without any luck. {{foreach $row->stats(TRUE) as $k => $v}} <li {{if in_array( $k, $row->hotStats )}}class="ipsDataItem_stats_hot" data-text='{lang="hot_item"}' data-ipsTooltip title='{lang="hot_item_desc"}'{{endif}}> <span class='ipsDataItem_stats_number'>{number="$v"}</span> <span class='ipsDataItem_stats_type'>{lang="content_records_stat_{$k}" pluralize="$v"}</span> </li>{{endforeach}} Â
iJeff Posted September 2, 2018 Author Posted September 2, 2018 14 minutes ago, Martin A. said: $row->mapped('views')  Nope didn't work. throwing error...
iJeff Posted September 2, 2018 Author Posted September 2, 2018 1 minute ago, Martin A. said: Where, and how, are you using it? I am using it record page ... as below. Quote {$row->mapped('views')} Â
Martin A. Posted September 2, 2018 Posted September 2, 2018 In that case, $record->mapped( 'views' ) is what you're after.
iJeff Posted September 2, 2018 Author Posted September 2, 2018 1 minute ago, Martin A. said: In that case, $record->mapped( 'views' ) is what you're after. Thanks worked like a charm! 🙂
andavis Posted November 8, 2018 Posted November 8, 2018 And how can I do this visible only for admins?
bfarber Posted November 8, 2018 Posted November 8, 2018 {{if \IPS\Member::loggedIn()->isAdmin()}} Â {$record->mapped('views')} {{endif}}
Recommended Posts
Archived
This topic is now archived and is closed to further replies.