Kelby Posted June 3, 2020 Share Posted June 3, 2020 (edited) Hello, How to tweak this code to add latest Knowledge-base articles: {if $kbmostviews} <h2>{$LANG.knowledgebasepopular}</h2> <div class="kbarticles"> {foreach from=$kbmostviews item=kbarticle} <a href="{routePath('knowledgebase-article-view', {$kbarticle.id}, {$kbarticle.urlfriendlytitle})}"> <span class="glyphicon glyphicon-file"></span> {$kbarticle.title} </a> {if $kbarticle.editLink} <a href="{$kbarticle.editLink}" class="admin-inline-edit"> <i class="fas fa-pencil-alt fa-fw"></i> {$LANG.edit} </a> {/if} <p>{$kbarticle.article|truncate:100:"..."}</p> {/foreach} </div> {/if} Edited June 3, 2020 by Kelby 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 3, 2020 Share Posted June 3, 2020 4 hours ago, Kelby said: How to tweak this code to add latest Knowledge-base articles: for this, the template wouldn't be the issue - the template wouldn't know what the latest articles were, so you would have to wrote a hook to query the database to get the latest articles, return it to the template - either as the existing variable or as a new variable and adjust the template content. 1 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.