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:
+Root
++Geography
++Politics
++Economy
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.id)}">{!article.title}</a><br/>
</apex:repeat>
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, article.id)} 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.