function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
huskerwendyhuskerwendy 

Customize Public Knowledge CSS/Visualforce Pages

We're trying to customize Public Knowledge and prevent Salesforce from rendering it's own CSS using standardStylesheets="false". Here's the code on the we're using on the VisualForce page at the beginning of the page:

<apex:page cache="false"
  standardStylesheets="false"
  showHeader="false"
  sidebar="false"
  standardController="KnowledgeArticle"
  extensions="pkb_Controller"
  language="{!pkbCon.selectedLanguage}"
  applyBodyTag="false"
  applyHtmlTag="false"
  >
<html>


 

When I view the page source on the site, it seems to be ignoring the markup code on the Visualforce page and rendering it's own CSS. Are we using the correct code. Here's the code when I view the pagesource. How can we tell Salesforce not to display their CSS?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html style="display:none !important;"><head><script src="/nonprofit/static/111213/js/perf/stub.js" type="text/javascript"></script><script src="/faces/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript?rel=1407535568000" type="text/javascript"></script><script src="/nonprofit/static/111213/js/functions.js" type="text/javascript"></script><script src="/nonprofit/jslibrary/1407441168000/sfdc/main.js" type="text/javascript"></script><script src="/nonprofit/jslibrary/jslabels/1407441168000/en_US.js" type="text/javascript"></script><script src="/nonprofit/static/111213/desktop/desktopAjax.js" type="text/javascript"></script><script src="/nonprofit/static/111213/js/picklist.js" type="text/javascript"></script><script src="/nonprofit/jslibrary/1400606638000/sfdc/VFState.js" type="text/javascript"></script><script src="/nonprofit/EXT/ext-3.3.3/ext.js" type="text/javascript"></script><script src="/nonprofit/jslibrary/1400606638000/sfdc/Knowledge.js" type="text/javascript"></script><link class="user" href="/nonprofit/sCSS/31.0/sprites/1406583088000/Theme3/default/gc/zen-componentsCompatible.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/sCSS/31.0/sprites/1406583088000/Theme3/default/gc/elements.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/sCSS/31.0/sprites/1406583088000/Theme3/default/gc/common.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/sCSS/31.0/sprites/1405452552000/Theme3/gc/dStandard.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/sCSS/31.0/sprites/1407963638000/Theme3/00D600000006nRH/00560000002U8r0/gc/dCustom0.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/sCSS/31.0/sprites/1406583088000/Theme3/default/gc/extended.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/sCSS/31.0/sprites/1406583088000/Theme3/default/gc/setup.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/EXT/ext-3.3.3/resources/css/ext-all-notheme.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/sCSS/31.0/sprites/1406583088000/Theme3/default/gc/ExtCSS-SFDC.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/sCSS/31.0/sprites/1406583088000/Theme3/default/gc/knowledge.css" rel="stylesheet" type="text/css" /><link class="user" href="/nonprofit/sCSS/31.0/sprites/1406583088000/Theme3/default/gc/knowledgeHome.css" rel="stylesheet" type="text/css" /><script type="text/javascript">
//<![CDATA[
try{(function(){var w=self,l,p,o;if(w&&top){for(;w!==top&&(p=w.parent)&&p!==w&&(o=p.location)&&o.protocol===(l=w.location).protocol&&(o.host===l.host||(p.document&&p.document.domain===w.document.domain));w=p);if(w!==top)throw "";}({f:function(){document.documentElement?document.documentElement.style.display="":(!this.a&&(this.a=10),this.a<1E5&&(window.sfdcRetryShowWindow=this)&&setTimeout("sfdcRetryShowWindow.f()",this.a),this.a*=2)}}.f())})();}catch(e){if(top!==self)top.location=location;else throw e;}//]]></script></head>
<html>

bob_buzzardbob_buzzard
The PKB takes over the whole site via the template.  If you view the source for that, it isn't actually using composition at all, instead it is a single page that morphs its behaviour based on the parameters.  You'll need to change the styling in the site templte to override.