1

Is it possible to create custom sidebar in visual force page? I want to have a sidebar similar to the one we see in Setup page.

Image

Like this!. Is there a way to do this?

0

1 Answer 1

5

There is no standard Visualforce component for a sidebar or such a layout design. But Visualforce is fully compatible with your own HTML and CSS, so you can build this the way you'd do normally.

<apex:page>
  <style>
     /* inline css stuff you'd need to align the divs*/
  </style>
  <!-- refering to a stylesheet file is prefered ofc, as that can be cached. -->
  <apex:stylesheet value="/resources/htdocs/css/basic.css"/>

  <div id="this is my sidebar">
     <!-- you can use visualforce components inhere-->
  </div>
  <div  id="this is my main content div">
       <!-- you can use visualforce components inhere-->
  </div>
</apex:page>

How to specifically do this with HTML and CSS is not salesforce specific and better asked at stackoverflow.

2
  • Oh ok, so can i use apex tags inside those div, like <apex:pageblock> <apex:pageblocktable> ? Apr 18, 2014 at 13:58
  • yes, that's how it works. Apr 18, 2014 at 14:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .