Take the 2-minute tour ×
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.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
Oh ok, so can i use apex tags inside those div, like <apex:pageblock> <apex:pageblocktable> ? –  Akash Nidhi P S Apr 18 at 13:58
    
yes, that's how it works. –  Samuel De Rycke Apr 18 at 14:12

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.