Applies To: SharePoint 2010
We’ve been using the MetaData Navigation on a site with custom branding and everything’s been working great. Recently, they decided to remove the Key Filters. This was simple enough using the List Settings but I quickly found that the width of the Left Panel automatically cut off my taxonomy item names without the Key Filters there to stretch it.
Users can easily grab the little bar and grow this part of the left panel’s treeview, but why should they have too for initial viewing? Some quick digging in the rendered HTML showed that the Left Panel’s width was set to 155 px by default. All I wanted was to change that to 200 px.
So, I opened my custom master page (based on v4.master) and went to the div with id=”s4-leftpanel” and found that the style was not set there and was being set in code somewhere. No worries, if you do set it here, it won’t be overridden by whatever part of the code assigns these values. So to adjust your default width just add a style attribute to your s4-leftpanel div:
<div id="s4-leftpanel" style="width:200px;">
If you save this and check it on a live site you’ll find things don’t look right. The key is to also adjust the MSO_ContentTable div to have a matching left margin:
<div id="MSO_ContentTable" style="margin-left:200px;">
Voila! That’s it! The width can still be adjusted by the end user using the grab bar, but the default is set and you are happy.