function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
spaceman901spaceman901 

Can't not display a list of article titles with knowledge:articleList component

Just started developing with VF.

 

I have the following:

 

<apex:page sidebar="false" title="Article List">

<knowledge:articleTypeList articleTypeVar="articleType">      {!articleType.label}<br /> </knowledge:articleTypeList>

<knowledge:articleList articleVar="article">     {!article.title} <br/> </knowledge:articleList>  

</apex:page>

 

I'm able to display the article types, but not the article title.

 

I'm believe I have set up the article permission and user permissions to read the articles accordingly.

 

Any help you be great to hear.


Thanks.

spaceman901spaceman901

Just to add to my previous post. 

 

I have about 20 articles imported and the articles can be viewed in the "Article Management" tab.

 

Thanks.

CharlyGCharlyG

Hi,

 

The following code is straight out of the Knowledge Dev Guide

 

<apex:page sidebar="false" title="Article List">
<style>
td{
vertical-align : top;
text-align: left;
}
</style>
<apex:form >
<apex:pageBlock title="Article List" >
<apex:panelGrid width="100%">
<table width="99%">
<tr>
<th width="33%">Title</th>
<th width="33%">Article Type</th>
<th width="33%">Summary</th>
</tr>
</table>
<knowledge:articleList articleVar="article" hasMoreVar="false" pageSize="10">
<table width="99%">
<tr>
<td width="33%">
<apex:outputLink target="_blank" value="{!URLFOR($Action.KnowledgeArticle.View,
article.id,['popup' = 'true'])}">{!article.title}</apex:outputLink>
</td>
<td width="33%"><apex:outputText >{!article.articleTypeLabel}</apex:outputText></td>
<td width="33%"><apex:outputText >{!article.abstract}</apex:outputText></td>
</tr>
</table>
</knowledge:articleList>
</apex:panelGrid>
</apex:pageBlock>

 In the code fragment below, the knowledge:articleList Visualforce component lets you create the article list. The
pageSize attribute prevents it from showing more than 10 articles in the list.


<knowledge:articleList articleVar="article" hasMoreVar="false" pageSize="10">

 

I hope this helps.

 

Charly

spaceman901spaceman901

Hi Charly,

 

Actually, I was going through the Knowledge Dev Guide when I first discovered the problem.

 

I simplied the VF in my previous post to demonstrate that the knowledge:articleTypeList works correctly, but the knowledge:articleList component doesn't.

 

Therefore, I'm having the same problem even with the code in the Knowledge Dev Guide.

 

Thanks for the help though.

 

CharlyGCharlyG

Hi Spaceman,

The docs say:

knowledge:articleList  is a loop on a filtered list of articles. You can use this component up to four times on the same page. 

 

I added the following in my dev org :

<apex:page sidebar="false" title="Article List">

<knowledge:articleTypeList articleTypeVar="articleType">      {!articleType.label}<br /> </knowledge:articleTypeList>

<knowledge:articleList articleVar="article">

  <li>   {!article.title} </li>

 </knowledge:articleList>  

</apex:page>

 

as well as the code below. And nothing! Nothing shows. So I am with you on this one.

 

<apex:outputPanel layout="block">
    <ul>
        <knowledge:articleList articleVar="article" categories="products:phone" sortBy="mostViewed" pageSize="10"
        >
            <li><a href="{!URLFOR($Action.KnowledgeArticle.View, article.id)}">{!article.title}</a></li>
        </knowledge:articleList>
    </ul>
</apex:outputPanel>
spaceman901spaceman901

Hi Charly,

 

That's good to know.

 

Thanks for checking.

 

The knowledge:articleList component doesn't seem to be returning anything as I have inserted a <p>test</p> statement within the component and nothing prints out.

 

I guess I will need to find a work around for this one.

 

Thanks. 

francoisLfrancoisL

Hi, 

 

This component is normally straight forward and work pretty well.

 

Did you try to use another sort attribute to check if it's not coming from the fact that in your demo org, nobody look article so most view is empty?

spaceman901spaceman901

Hi Francois,

 

I was following the Knowledge Dev Guide step by step when I came across this.

 

I have been using the VF in the Dev Guide as my reference and I believe the VF in the "VF Article List Code Sample" does not use a sort attribute.

 

I have tried other sort attributes such as sort and keyword with values such as title and lastUpdated, but still getting an empty list.

 

Please let me know if I answered your question appropriately.

 

Thanks.

francoisLfrancoisL

Did you check your user have access to Article (CRUD, Data Category visibility)

spaceman901spaceman901

Hi Francois,

 

I just realized I mssed the note on page 10 of the Knowledge API Guide that the component <knowledge:articleList> list only published articles.

 

Once published, I'm now able to see the articles.

 

Thanks