Jump to content

More most read KB articles?


Magistar

Recommended Posts

The current most read KB articles seems to be 5. I would like to increase this to 10.

I checked the templates:

{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>&nbsp;{$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}

But it looks like there is no way to change the loop number there. Can this be done somewhere else?

Link to comment
Share on other sites

11 minutes ago, Magistar said:

Can this be done somewhere else?

sadly, it will be hardcoded to return a maximum of 5 articles.

the solution would be a ClientAreaPageKnowledgebase hook that recreates $kbmostviews - it should just be a query of the tblknowledgebase db table, sorted by views in descending order, with a limit of 10.... one part of the result might need a little tweak to follow the existing array though.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated