3

I am trying to create a simple page using Bootstrap within salesforce. I need this page to have the standard salesforce header and sidebar. When I use the standard bootstrap library via a CDN and the page is affecting all the CSS styling for my standard salesforce headers and side bars. Any help on how to prevent this ?

  • I'm assuming you want to keep the headers and side bars? – zainogj Jun 9 '15 at 16:18
  • Yes I want to keep the header and sidebar – CodeNinja Jun 9 '15 at 16:19
  • 2
    Unsure if this should be a comment or an answer so I will air on the side of caution......In order to use the standard sidebar and headers of SF with a bootstrapped page, you need to namespace the Bootstrap css files. Check out this post on how you can accomplish this. [bracketlabs.com/blog/2014/1/20/… – Chris Duncombe Jun 9 '15 at 16:19
  • There are also some existing libraries out there you can leverage as well. Visualstrap is one i have played with in the past [blogforce9dev-developer-edition.ap1.force.com/… – Chris Duncombe Jun 9 '15 at 16:21
  • The namespacing is probably the way to go, but wouldn't another option be to use VF components? Create a VF Component with the content you want, styled with Bootstrap, then reference the component in a VF page that uses header and sidebar. I've never tried that, but hypothetically, I don't see why it wouldn't work. – zainogj Jun 9 '15 at 16:23
0

You can add namespace your bootstrap css file to avoid it. Both Less and Saas supports namespacing css files.

  • 2
    Can you provide an example that illustrates how the namespace would be added in the Visualforce page? Or a link to an example? – Keith C Jun 9 '15 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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