Invision Community 5: A video walkthrough creating a custom theme and homepage By Matt Thursday at 04:02 PM
Owdy Posted January 12, 2020 Posted January 12, 2020 I dont wanna show how many times they are read. How to hide that?
bfarber Posted January 13, 2020 Posted January 13, 2020 You'd have to use a clever CSS selector, or edit the recordFeed widget template in the theme system.
Owdy Posted January 26, 2020 Author Posted January 26, 2020 I tryed edit template. Seems there isnt anything related view count.
bfarber Posted January 27, 2020 Posted January 27, 2020 {{foreach $row->stats(FALSE) as $k => $v}} <li {{if $k == 'num_views'}}class='ipsType_light'{{elseif \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="{$k}" pluralize="$v"}</span> {{if ( $k == 'forums_comments' OR $k == 'answers_no_number' ) && \IPS\forums\Topic::modPermission( 'unhide', NULL, $row->container() ) AND $unapprovedComments = $row->mapped('unapproved_comments')}} <a href='{$row->url()->setQueryString( 'queued_posts', 1 )}' class='ipsType_warning ipsType_small ipsPos_right ipsResponsive_noFloat' data-ipsTooltip title='{lang="queued_posts_badge" pluralize="$row->topic_queuedposts"}'><i class='fa fa-warning'></i> <strong>{$unapprovedComments}</strong></a> {{endif}} </li> {{endforeach}} if( $k != 'views' ).... inside the loop
Owdy Posted January 28, 2020 Author Posted January 28, 2020 What template is that? Mine looks differed. {{if !empty( $records ) }} <h3 class='ipsWidget_title ipsType_reset'>{$title}</h3> {{if $orientation == 'vertical'}} <div class='ipsPad_half ipsWidget_inner'> <ul class='ipsDataList ipsDataList_reducedSpacing ipsContained_container'> {{foreach $records as $record}} <li class='ipsDataItem'> <div class='ipsDataItem_icon ipsPos_top'> {template="userPhoto" group="global" app="core" params="$record->author(), 'tiny'"} </div> <div class='ipsDataItem_main cWidgetComments'> <div class="ipsCommentCount ipsPos_right {{if ( $record->record_comments ) === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="num_replies" pluralize="$record->record_comments"}'>{expression="$record->record_comments"}</div> <div class='ipsType_break ipsContained'> <a href="{$record->url()->setQueryString( 'do', 'getLastComment' )}" title='{lang="view_this_cmsrecord" sprintf="\IPS\Member::loggedIn()->language()->addToStack( 'content_db_lang_sl_' . $record::$customDatabaseId, FALSE ), $record->_title"}' class='ipsDataItem_title'>{$record->_title}</a> </div> <p class='ipsType_reset ipsType_medium ipsType_blendLinks'> <span>{lang="byline_nodate" htmlsprintf="$record->author()->link()"}</span><br> <span class="ipsType_light">{datetime="$record->mapped('date')"}</span> </p> </div> </li> {{endforeach}} </ul> </div> {{else}} <div class='ipsWidget_inner'> <ul class='ipsDataList ipsContained_container'> {template="recordRow" group="listing" location="database" app="cms" themeClass="IPS\cms\Theme" params="null, null, $records"} </ul> </div> {{endif}} {{endif}}
Meddysong Posted January 28, 2020 Posted January 28, 2020 Yours is a horizontal record feed, isn't it? If so, those details are coming from this line: {template="recordRow" group="listing" location="database" app="cms" themeClass="IPS\cms\Theme" params="null, null, $records"} So you need to track down the relevant bit of code in the recordRow template which your database is using for its listing.
Owdy Posted January 28, 2020 Author Posted January 28, 2020 That isnt template="recordRow". There arent any "views"
Meddysong Posted January 28, 2020 Posted January 28, 2020 1 hour ago, Owdy said: That isnt template="recordRow". There arent any "views" It's in this bit here: {{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}} But I've got some bad news for you. To test it, I edited a line to read <span class='ipsDataItem_stats_type'>xx{lang="content_records_stat_{$k}" pluralize="$v"}</span> and this was the result: So if you want to remove views, you'll lose the comments as well.
bfarber Posted January 29, 2020 Posted January 29, 2020 I was showing the topicRow template (sorry, it wasn't clear from the screenshot what you were looking at specifically but I see you clarified in the topic title now). You would change the bit Meddysong showed to {{foreach $row->stats(TRUE) as $k => $v}} {{if $k != 'views'}} <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> {{endif}} {{endforeach}}
Recommended Posts
Archived
This topic is now archived and is closed to further replies.