SharePoint Tip of the Day – Easily allow your contributors to see what an end user will see


A common requirement in all SharePoint projects that I’ve be working on is to see what an end-user / visitor will see. The publishing console have the option “preview in another window” but you need to have the console activated / displayed and it’s not always obvious for someone who doesn’t know where to look for such an option. Fortunately, it’s really easy to add a simple link in your page layout (or master page in any “toolbox area”), just use the current page url and append
?PagePreview=true, a target=_blank will finish the job to keep the current page being edited opened !

And if you want to add this to a site action button, you can simply reuse this snippet that I just did

    <CustomAction
      Id=”SiteActionsToolbar”
      GroupId = “SiteActions”
      Location=”Microsoft.SharePoint.StandardMenu”
      Sequence=”2001″
      Title=”Preview page in a new window”
      ImageUrl=”~site/_Layouts/Images/menuslideshow.gif” 
      RequireSiteAdministrator=”False”>
        <UrlAction Url=”javascript:window.open((window.location + ‘?PagePreview=true’), ‘Preview’, ”);” />
    </CustomAction>

Hope it helped !

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s