I am trying to display information about Knowledge Articles on my page. One of the things I want to display is the most viewed article stat.
I have a Visualforce Apex component that looks like this:
<apex:component controller="Component_Query" access="global">
<apex:attribute name="QueryString" type="String" required="true" access="global" assignTo="{!queryString}"
description="A valid SOQL query in string form." />
<apex:variable value="{!results}" var="results"/>
<apex:componentBody />
</apex:component>
I have a Visualforce page that looks like this:
<apex:page >
<table id="articles">
<knowledge:articleList articleVar="article" sortBy="mostViewed" pageSize="5">
<tr>
<td>{!article.articlenumber}</td>
<td><a target="_parent" href="{!URLFOR($Action.KnowledgeArticle.View, article.id)}">{!article.title}</a></td>
<td>{!article.articletypelabel}</td>
<td>{!article.lastpublisheddate}</td>
<td>
<c:Query_component queryString="SELECT NormalizedScore FROM KnowledgeArticleViewStat WHERE ParentId = '{!article.id}'">
<apex:repeat value="{!results}" var="result">
</apex:repeat>
</c:Query_component>
</td>
</tr>
</knowledge:articleList>
</table>
</apex:page>
I put the Visualforce Page into a tab. When I view the page, all the information about the knowledge articles show up except for the information about the most viewed stat. How do I see this stat?
This is what I ended up using in my Visualforce page: