HostinPK Posted July 12, 2015 Share Posted July 12, 2015 I can't see Number of views for articles in Knowldegebase after update to the latest version 6. Every article had number of views in bracket in front in v5 but not in v6. Anyone else having this issue? 0 Quote Link to comment Share on other sites More sharing options...
HostinPK Posted July 20, 2015 Author Share Posted July 20, 2015 Mods @ Please move this thread to "Customisation and Integration Questions" - - - Updated - - - and here is WHMCS support reply "The number of article views is not displayed in the default template, but it is displayed in the older portal and classic templates. It should be possible to copy the {$kbarticle.views} tag from these templates into the default template knowledgebasecat.tpl file in order to display it there too." I am using six template and want to show the number of views. Can anyone help me in this regard using the guideline given above. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 20, 2015 Share Posted July 20, 2015 you could modify six/knowledgebasecat.tpl and replace... <div class="kbarticles"> {foreach from=$kbarticles item=kbarticle} <a href="{if $seofriendlyurls}{$WEB_ROOT}/knowledgebase/{$kbarticle.id}/{$kbarticle.urlfriendlytitle}.html{else}knowledgebase.php?action=displayarticle&id={$kbarticle.id}{/if}"> <span class="glyphicon glyphicon-file"></span> {$kbarticle.title} </a> <p>{$kbarticle.article|truncate:100:"..."}</p> {foreachelse} {include file="$template/includes/alert.tpl" type="info" msg=$LANG.knowledgebasenoarticles textcenter=true} {/foreach} </div> with... <div class="kbarticles"> {foreach from=$kbarticles item=kbarticle} <a href="{if $seofriendlyurls}{$WEB_ROOT}/knowledgebase/{$kbarticle.id}/{$kbarticle.urlfriendlytitle}.html{else}knowledgebase.php?action=displayarticle&id={$kbarticle.id}{/if}"> <span class="glyphicon glyphicon-file"></span> {$kbarticle.title} </a> <p>{$kbarticle.article|truncate:100:"..."}</p> <span class="badge badge-info">{$kbcat.numarticles}</span> <p>{$LANG.knowledgebaseviews}: {$kbarticle.views}</p> {foreachelse} {include file="$template/includes/alert.tpl" type="info" msg=$LANG.knowledgebasenoarticles textcenter=true} {/foreach} </div> or if you wanted to show the number of views in a badge... <span class="badge badge-info">{$LANG.knowledgebaseviews}: {$kbarticle.views}</span> 1 Quote Link to comment Share on other sites More sharing options...
HostinPK Posted July 20, 2015 Author Share Posted July 20, 2015 Hello Brian @ Thanks for the help. Anyhow, I am still unable to resolve this. Check screenshots of v5 default template and v6 six template. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 20, 2015 Share Posted July 20, 2015 the popular kb articles are in kbknowledgebase.tpl, so you'll need to modify a different template for that... ~line 34 <span class="glyphicon glyphicon-file"></span> {$kbarticle.title} ({$LANG.knowledgebaseviews}: {$kbarticle.views}) that will add a bracketed number of views for the popular articles. it's also worth noting that the views number is in all three kb templates in Portal, so you might need to consider adding it to knowledgebasearticle.tpl too. 1 Quote Link to comment Share on other sites More sharing options...
HostinPK Posted July 20, 2015 Author Share Posted July 20, 2015 Thanks brian @ It worked perfectly. Thanks for your help. Best Regards 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.