Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Hiding a web zone using CEWP

  Asked By: Krista    Date: Aug 24    Category: Sharepoint    Views: 6191

Is there a way to hide an entire web zone (namely the right zone on a
site based on the blank site template) using the CEWP in the same
manner one can hide the Quick Launch bar? I've searched old threads
here and Google, but haven't come up with anything.

I could create a new site template, but I have no control over this
particular server, and getting the sysadmins to install a custom site
template would probably require testing and paperwork.

I've tried looking at the page source to figure out which ID each zone
has, and then using getElementById to get the object and change its
display value, but that just generates JavaScript errors. Has anyone
managed to hide a zone?



4 Answers Found

Answer #1    Answered By: Jennifer Jones     Answered On: Aug 24


#MSOZoneCell_WebPartWPQ2 {display:none}

do a view source  of the page  to get the zone  id.

Answer #2    Answered By: Annie Norris     Answered On: Aug 24

Here some script that will hide  the zone  that a CEWP is in unless the
page is in Design mode or a Toolpane is open:

function HideMyZone_WPQ_()
var InDesignMode =

var ToolpaneMode =

if(InDesignMode.value > 0 || ToolpaneMode.value > 0)
//Let the Zone show
//Hide the Zone that this web  Part is in
var webpartCell = WebPart_WPQ_.parentNode;
var webpartTable =
var zone =
zone.style.display = "none";
window.status = "ERROR: HideMyZone_WPQ_: " + e.Message;
window.attachEvent("onload", HideMyZone_WPQ_);

Answer #3    Answered By: Chadd Hahn     Answered On: Aug 24

I had no idea that the web  Zone was the 4th generation
parent of the web part table. I guess that's why I couldn't figure
out what to do by studying the IDs in the rendered page's HTML source.

This is great for the servers where we can't easily touch the site
templates directory.

Answer #4    Answered By: Laura Walker     Answered On: Aug 24

It's too bad that Web Parts rely on HTML tables. First, they don't meet
accessibility standards. Second, the parentage of a table, tablebody,
tr, and td are not fun to work with. Divs should be sufficient but MS
didn't build it that way.

Didn't find what you were looking for? Find more on Hiding a web zone using CEWP Or get search suggestion and latest updates.