- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 09:29 PM
Hello there, Just wondering how would you show the eye icon for view count on a Widget portal - would this be scripted in the Body HTML template of the Widget? The eye icon shows on the Widget above but I can't seem to get it to show for the Widget below? I have tried copying the script from the widget where it is showing but no luck. Thank you.
Solved! Go to Solution.
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 09:45 PM
Hello
did you clone the widget ?
Because it looks like you have cloned the OOB KB Most Viewed widget .
For the eye icon usually there will be OOB code which eye glyph icon
<glyph sn-char="eye-open" class="pad-right" />
this is the exact line
<sp-panel ng-if="data.articles.length > 0" >
<ul class="list-group">
<li class="list-group-item" ng-repeat="a in data.articles">
<a href="?id=kb_article&sys_id={{::a.sys_id}}">{{::a.short_description}}</a>
<div>
<span ng-if="a.sys_view_count == 1" class="views pad-right">
<glyph sn-char="eye-open" class="pad-right" />
${{{::a.sys_view_count}} View}
</span>
<span ng-if="a.sys_view_count > 1" class="views pad-right">
<glyph sn-char="eye-open" class="pad-right" />
${{{::a.sys_view_count}} Views}
</span>
<span ng-if="false" class="published pad-right">
<span ng-if="a.sys_view_count > 0" class="pad-right">•</span> <glyph sn-char="calendar" class="pad-right" />
<sn-day-ago date="a.published"/>
</span>
</div>
</li>
</ul>
</sp-panel>
if you have cloned the widget then this line should be there
hope this helps
please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 09:45 PM
Hello
did you clone the widget ?
Because it looks like you have cloned the OOB KB Most Viewed widget .
For the eye icon usually there will be OOB code which eye glyph icon
<glyph sn-char="eye-open" class="pad-right" />
this is the exact line
<sp-panel ng-if="data.articles.length > 0" >
<ul class="list-group">
<li class="list-group-item" ng-repeat="a in data.articles">
<a href="?id=kb_article&sys_id={{::a.sys_id}}">{{::a.short_description}}</a>
<div>
<span ng-if="a.sys_view_count == 1" class="views pad-right">
<glyph sn-char="eye-open" class="pad-right" />
${{{::a.sys_view_count}} View}
</span>
<span ng-if="a.sys_view_count > 1" class="views pad-right">
<glyph sn-char="eye-open" class="pad-right" />
${{{::a.sys_view_count}} Views}
</span>
<span ng-if="false" class="published pad-right">
<span ng-if="a.sys_view_count > 0" class="pad-right">•</span> <glyph sn-char="calendar" class="pad-right" />
<sn-day-ago date="a.published"/>
</span>
</div>
</li>
</ul>
</sp-panel>
if you have cloned the widget then this line should be there
hope this helps
please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 12:53 PM
any follow up required ? if yes let me know
if not close the thread by marking the answer correct so that it will be helpful to future readers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 07:01 PM
Yes thank you Mohith, it worked & I've ticked this as 'marked as Correct Answer'. I posted another question regarding adding the eye glyph to "knowledge MostUseful articles' widget. Regards Winnie.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 04:46 PM
Thank you Mohith that worked! I initially cloned this Widget: Knowledge MostViewed Articles and tried to modify the scripts in there, but wasn't working. When I added the OOTB widget: KB Most Viewed to the instance, it works as expected. Not sure what the difference is between the 2 widgets? I have another query to do the same to the Knowledge MostUseful Article which I cloned and trying to copy scripts, but currently not working? I will do more testing and if no luck will post a separate question for it. Appreciate your time! Regards Winnie