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
Danny LeungDanny Leung 

How to hide narrow column in customer portal home page?

When I set up the home page layout for my customer portal home page, I de-select all the narrow components because I do not want to show any of them to my customers.  When I log in as a customer and land on the customer portal’s home page, I can see components in the wide column.  However, the narrow column is still displayed as an empty column.  Is it possible to hide the empty narrow column entirely so that the wide column can occupy the full width of the home page?

 

Thanks

Danny

Ispita_NavatarIspita_Navatar

You mean the left sidebar of the page, for this in the page tag set sidebar to false.

 

<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" sidebar="false">

 

In case you want the sidebar to appear at other places, then check the profile of the logged in user in the constructor of your page and set a property say "ShowSidebar" to true if profile is a non customer portal user profile else set it to true and then set the sidebar to this property.

 

<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" sidebar={!ShowSidebar}>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

 

 

b-Forceb-Force

If I am reading correctly, you want to hide narrow component,and render wide component to full page, Here is workaround Create a narrow component as HTML source code for it

 

 

<div id="hideme"><script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.js" type="text/javascript"></script><script language="JavaScript"> var $J=jQuery.noConflict(); $J(document).ready(function(){var sb=document.getElementById("sidebarDiv");var bc=document.getElementById("bodyCell");if(sb){sb.parentNode.removeChild(sb);}bc.className="unknownclassName";});</script></div>

 

 

 

add this on home page, This will render home page on full page,and for all other pages too.

If you want to restrict this functionality only for Home page , let me know I will post updated script

we need to update script based on home page url

 

 

 

Thanks,

Bala

Danny LeungDanny Leung

Hi, Bala

 

According to your suggestion, I created a narrow component named "Narrow Column Suppressor" to contain your suggested HTML source code.  When I log in as a customer portal user, I still see the narrow column with the Narrow Column Suppressor component in it.

 

One thing I noticed is that when I go back to the narrow component to look into the HTML code in it, I found that it only contains <div id=hideme></div>.  It seems Force.com removed all other script elements automatically.  Did I miss anything when I inputting the HTML code?

 

Thanks

Danny

SørenKrabbeSørenKrabbe

Hi,

 

Bala's suggested solution works fine when I test it in a sandbox environment. Don't forget to check the "show HTML" box before pasting in the HTML/JavaScript code.

If you already have a custom header document defined for your customer portal, it might be more logical to paste Bala's code there instead (then you don't need the <div> elements of the code)

 

That said, don't forget to beware of the following:

* Salesforce don't guarantee the HTML element names to be constant. I.e. future salesforce releases might break the solution without you knowing it.

* Importing the jquery library (even from an external source) for this rather simple and isolated functionality could seem like overkill