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
Captain62Captain62 

Adding knowledge:categoryList to a publicly accessible Community page causes that page to prompt for a login

I have a Salesforce Community site set to Public Access, and Data Category visibility is set to "All" under the Public Access Settings, but the page below prompts for a login
<apex:page title="Hello World" applyHtmlTag="false" cache="false" docType="xhtml-1.1" showHeader="false" standardStylesheets="false">
    <apex:composition template="{!$Site.Template}">
        <apex:define name="content">
                <h1>Hello World</h1>
                <ul>
                    <knowledge:categoryList categoryGroup="Feature" categoryVar="cat" level="1" rootCategory="All">
                        <li><a href="/kb/browse?id={!cat.name}&g=Feature">{!cat.label}</a></li>
                    </knowledge:categoryList>
                </ul>
        </apex:define>
    </apex:composition>
</apex:page>
When the <knowledge:categoryList> tag is removed the page loads without prompting for a login.
 
Captain62Captain62
I should also note the same thing happens <knowledge:articleList>, however (and most importantly) this same page on a Portal Site (not a Community Site) does not prompt for a login and just displays the category list / article list.
 
Vishnu VaishnavVishnu Vaishnav
hi Captain 62,
 You shoud run your page directly in org , and see what actually error is this.

I think it'll help to reach out exact error.
 
Vishnu VaishnavVishnu Vaishnav
Can u tell me when this page is showing on site , my mean that afte login and before login .
Captain62Captain62
It is our Community Site Home Page. We want to list all the latest articles of a certain type (for example the latest alerts and bugs found in our product), but don't want users to need to login to see the homepage.
Captain62Captain62
Running "in org" means I am logged in, and the page runs correctly (because I'm logged in). Logging out, re-prompts for a login to view the page.
Vishnu VaishnavVishnu Vaishnav
Hi Captain,
got it, its issue with public access setting.
May be you gave permission only for Community portal not on site.
bcoz here is two places where we need to give permissions.
first one is site ans another one is community portal.
Actually i faced this error once so i think it will hellp u.

Cheers