Adobe CQ – Toggle Preview


Adobe-CQ-264x300The coolest little tip/trick I’ve used in CQ in a while is the Toggle Preview trick that I came across a while ago.  This is not mine and I can’t for the life of me find where I picked it up from, so I apologize for not giving credit where credit is due.  I will update this when I find it.

Back to our program:  The Toggle Preview – When you are on your author instance, making many fine content edits, you might say to yourself, “Self?  I wish I could really see what this page looks like without having to deploy this page to dev/stage/whatever just to see if the CSS it rendering correctly.”  Yes, this is the lament of many CQ developers/designers.  Until today.

With this spectacular offer, you will get a a bookmark that will allow you to toggle the WCM mode  (enables/disabled).  What you get when the WCM mode is enables is nothing.  No sidekick and no left-nav DAM interface.  Just your page.  Here’s how it works…

  1. Create a new bookmark in your browser(s) of choice.  Give any name you like (I chose ‘Toggle Preview’ because I l like to live on the edge).
  2. Paste the code below into path.
  3. Navigate to your CQ Author instance and fire up your Experience Manager and find a page
  4. Take notice that your Sidekick and left-nav DAM interface are visible.
  5. Click on your new Toggle Preview shortcut
  6. Astonish your coworkers with your new sorcerous powers

Here’s the code.  Grab everything between the “===”:
=========================================

javascript:(function(){var a=”wcmmode=disabled”;var b=”/cf”;var c=function(a,b,c){var d=a;if(b.length!=0&&!(b.length==1&&b[0]==””)){d+=”?”+b.join(“&”)}d+=c;return d};var d=””;var e=[];if(window.location.search.substring(1)!=””){e=window.location.search.substring(1).split(“&”)}var f=””;if(window.location.pathname!=b){f=b+”#”+window.location.pathname;if(e.indexOf(a)!=-1){e.pop(a)}d=window.location.hash}else{f=window.frames[1].location.pathname;if(window.frames[1].location.search.substring(1)!=””){e=window.frames[1].location.search.substring(1).split(“&”)}if(e.indexOf(a)==-1){e.push(a)}d=window.frames[1].location.hash}var g=c(f,e,d);window.location=g})();

=========================================

Unfortunately, like other cool things, this will not work in CQ5.4 or Internet Explorer.

Please let me know if you have any issues with this.  I’ll be happy to help, if I can.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s