2

Is it possible to add custom CSS stylesheets to Chatter Communities, without building a completely custom site using Force.com Sites or Site.com? Chatter Communities allows customization by inserting an HTML header, but the HTML header is actually injected into the body element of the rendered page.

Furthermore, standard merge fields such as {!Community_Name} that work with email templates and Visualforce are not recognized in the HTML header. This implies to me that the URLFOR() function and Static Resources will not work with this HTML header.

  • 2
    I have not worked on the chatter communities, but if adding a HTML is similar to adding the HTML content in a Side bar component then you can refer the static resource with dynamic link <link rel="stylesheet" href="/resource/cssFileNameFromStaticResource"/> – Sam Sep 2 '13 at 5:15
  • The problem is that the HTML header is injected into the body element, not the head element. So, adding a link in this manner I believe would be against the HTMl5 standard. I did learn something new from your post in referencing CSS files uploaded as static resources, so thank you for your suggestion! – Marty C. Sep 3 '13 at 3:27
3

Right now I believe there is no way to do this that wouldn't involve some considerable hacks using Javascript, and even then I suspect getting Javascript to execute would be problematic as it'd likely have to be hosted elsewhere and imported into the page.

As always with these things, hacking it to get it working isn't recommended as future updates to the platform could easily break unsupported techniques, so I'd say your best bet is to either build something custom with sites or to just stick with standard styling and hope more cusomisation is available in the future.

  • 1
    Your conservative recommendation is well-taken, @LaceySnr. Sticking with supported functionality is likely the right answer to most organizations. I will reserve a hacked workaround for organizations that have the technical depth and interest in doing something more experimental until Sf release more customization capabilities for Communities. Thank you for the reminder! :-) – Marty C. Sep 3 '13 at 3:31
  • There are occasions where a hack is almost acceptable, generally those where you know you'll be around to put out any fires when the next release rolls around. But still, better to save yourself the hassle! – Matt Lacey Sep 3 '13 at 4:45

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.