Tell me more ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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.

share|improve this question
By any chance do you have this in a public site? I will be working on something similar and I am looking for ideas. Thanks. – PepeFloyd Nov 15 '12 at 22:56
@PepeFloyd, sorry I don't. – Alexandru Luchian Nov 16 '12 at 19:17

2 Answers

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
share|improve this answer
up vote 0 down vote accepted

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/>
</apex:repeat>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.