Find your content:

Search form

You are here

Display Articles in a tree like structure


I am trying to create a VisualForce page where I display our articles in a tree like structure.

There are only 2 levels in the tree, so like:





There are about 10 categories of level 2.

I tried using the <knowledge:articleList> for each level of the tree, but this tag can be used up to 4 times on a page.

Then, I tried extracting all articles in my controller:

SELECT Id, Title, KnowledgeArticleId FROM KnowledgeArticleVersion WHERE PublishStatus ...

And it works fine, the only thing that doesn't is the actual link to the article, I do:

<apex:repeat value="{!controllerArticles}" var="article">
    <a href="{!URLFOR($Action.KnowledgeArticle.View,}">{!article.title}</a><br/>

And when I go to the page it get the Unauthorized page. It's weird cause when I use the <knowledge:articleList> with the {!URLFOR($Action.KnowledgeArticle.View,} it works fine and I see the links correctly.

Does URLFOR($Action.KnowledgeArticle.View) action work only inside the <knowledge:articleList> ? If so, how can I create a link to an article?

Thank you.

Attribution to: Alexandru Luchian

Possible Suggestion/Solution #1

Two things to check:

  1. Have the users in question been grated access to view articles by way of their user profiles?
  2. Does the page work without error when run as yourself? Often with portal/sites pages, you'll get the 'unauthorised' notification when there has been an error and you're redirected to the internal-only error details page

Attribution to: Matt Lacey

Possible Suggestion/Solution #2

I found how to display a link to the Article.

<apex:repeat value="{!controllerArticles}" var="article">
    <a href="{!$Site.CurrentSiteUrl}articles/Article_Type/{!article.urlName}">{!article.title}</a><br/>

Attribution to: Alexandru Luchian
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content