The magic isdtp param

A couple of weeks back Andy Mahood posted an interesting question that cought my eye:

Is there a blog explaining report url params ?isdtp=mn shows report without headers, ?isdtp=nv shows no header and fewer colours #askforce

It’s a question I’ve asked myself in the past, and while my experience with the isdtp param isn’t exhaustive I have managed to get it to do what I want on more than one occasion.

A word of warning before I explain what this parameter does, this is 100% unsupported and you should avoid using this whenever possible. Salesforce may break it’s use on pages without much warning, so be warned this shouldn’t be used in anything that’s mission critical.

With that out of the way the isdtp parameter is a special parameter used in the service cloud console and the plain old console tab to make salesforce pages display without header, sidebar, and sometimes in a simplified style. Adding a ?isdtp=<option> or &isdtp=<option> to any salesforce page (even visualforce! ) will dramatically change the way it’s rendered.

There’s three useful options for the parameter that I’ve found so far:

vw - used by the service cloud console. This is the only option that supports the new aloha theme. It strips the salesforce header and sidebar from the page. There’s some small functionality degradation (enhanced lists are not longer enhanced, some ugly styles here and there) but this is your only option if you want to include chatter support through isdtp.

mn - the second most functional, but far behind the vw option. Like vw the header and sidebar are stripped out, but in addition chatter will always be removed as well, and the old salesforce theme (pre-aloha) will be used.</div>

lt - I have limited experience with this option, but as far as I can tell it’s exactly the same as mn, except that it removes the section header at the top of the page as well.

[Edit from 2014]</div><div class="separator" style="clear: both; text-align: left;">p1 - used by salesforce1 when rendering pages. I assume you should avoid using it, but you can check for it in a visualforce page to see if the page is being rendered inside a salesforce1 container.</div><div class="separator" style="clear: both; text-align: center;">
</div><div class="separator" style="clear: both; text-align: left;">Now for some words of warning: the isdtp parameter will break any and all apex:outputLink elements on a visualforce page with the apex:page showHeader parameter set to false. A showHeader of false prevents loading of salesforce javascript, and the isdtp param changes all links to a javascript method calls “srcUp” that is undefined. The solution is to set showHeader=”true” and use isdtp as well, which overrides it and hides the header, but showHeader must be true in your page. </div><div class="separator" style="clear: both; text-align: left;">
</div><div class="separator" style="clear: both; text-align: left;">The good news is that all apex:outputLink elements will automatically be updated to keep the isdtp parameter you set on all links it displays, meaning if you don’t use any native <a> tags in your page you won’t have to worry about loosing the param when a user clicks a link.</div><div class="separator" style="clear: both; text-align: left;">
</div><div class="separator" style="clear: both; text-align: left;">As with any internal API that’s been reverse engineered there’s probably more tricks waiting to be found, be warned this isn’t for the feint of heart!</div></div><div class="separator" style="clear: both; text-align: center;"></div>