SharePoint Content Query Web Part XSLT Smart Date Range Format

SharePoint Content Query Web Part XSLT Smart Date Range Format


The default placement of the web part properties toolpane is sometimes troublesome to custom designs as well as a horrible user experience. The method SharePoint uses to display this panel is basically wrapping your main content in a table and adding an extra column for this toolpane. This can blow out a custom design and make things look pretty ugly for the content editor. 

This method also causes issues when editing a long page where the toolpane and actual web part may not be visible at the same time. Causing the need to scroll back and forth to adjust the web part properties. 


Add the following below to your css and javascript. This is assuming you have installed jQuery and jQueryUI.

Update 7/11/2012 - Modified jquery to prevent dragging when using scrollbar that may appear in the properties panel. Also tweaked css to modify cursor selector.


/* web part tool pane */
.ms-ToolPaneOuter {
.ms-ToolPaneBody {
overflow:auto !important;
#MSOTlPn_ToolPaneCaption {
/* end web part tool pane */


$(document).ready(function (e) {

// move web part console
if($('.ms-ToolPaneOuter').size() > 0) {
   // shrink the add column
   // calc a good max height
   tpHeight = parseInt($(window).height()) - 300;
   // enable dragging of the panel, added handler to prevent scroll drag
   $(".ms-ToolPaneOuter").draggable({handle: '#MSOTlPn_ToolPaneCaption'});



Matthew Koon

Founder & CEO

Send a Message