VisualForce: Conditionally render HTML elements like <li>
Off the cuff, I believe you can overload the use of the <apex:variable>
tag along with its rendered attribute to show/hide individual elements.
<apex:variable var="foo" rendered="{!$ObjectType.objectname.accessible} >
<li> bar ... </li>
</apex:variable>
This is a bit off the cuff, but I think you can wrap it in a panel:
<apex:outputPanel rendered="{!$ObjectType.objectname.accessible}" layout="none"><!-- content --> </apex:outputPanel>
Would that work in your case?
One option would be to compose them server side, then display with <apex:dataList>
or <apex:repeat>
. Useful especially if the list will grow in future?
To do that build some wrapper apex class (or even something as simple as Map<String, String>
) that would hold the URL and display name. Anything you can do in VF with {!$ObjectType.Account.accessible}
you can check with Account.sObjectType.getDescribe().isAccessible()