SharePoint 2013 Composed Looks displays no items

I came across this while browsing my Azure SharePoint 2013 Site Collection.  Which I thought was strange considering my On-Prem SharePoint 2013 Site Collection displays the default templates.

Composed Looks - All Items

A quick Google Search, I came across this:

So the quickest and easiest way to get the templates into Composed Looks, is to create a sub-site and take a loot at the Composed Looks from that Sub-site.

On a sub-site I created all of the default template settings are shown as thus:



Useful Tip: This must be done from Internet Explorer (I used IE10), this will not work from Chrome.  I didn’t test it in Firefox.



Any questions or comments, post below.


Add a PDF Thumbnail Hover Preview Column to a Document Library

I got this request from Jewell from my previous post:

Display PDF Thumbnail Preview on Hover in Search Results Web Part

“Is there away to apply this to a document library?”

Here are the steps to add a pic of a magnifying glass to a column in a Document Library.

So that when your mouse hovers, it displays the first page of the PDF inside an iFrame window.

The only down-side to having this implemented, is that as the user hovers over each PDF, it needs to download the entire PDF file to display the first page.

* Document Library with the PDF Preview column added

pdfs - All Documents

* On Mouse-Over

pdfs preview

Step 1: First you’ll need to create a workflow that copies the Document Name to the Title column.

Follow this post to do exactly that:

Step 2: Go to and download the Scripts Zip file.

You’ll need the 3rd Example files uploaded to a Document Library to hold your script files.

Step 3: Open up main.js and replace the text with this modified version: PDF thumbnail script .docx or the pastebin version:

Step 4:  Create a html file in the same folder as your scripts and paste the following:

Don’t forget to change the paths to your script files.

<script src="/server/site/scripts/jquery.js" type="text/javascript" ></script>
 <script src="/server/site/scripts/main.js" type="text/javascript"></script>
 border:1px solid #ccc;
Step 5:
Add the HTML file to the source of a Content Editor Web Part in the document library that holds the PDF files.
Step 6: Add a Calculated Column in the Document Library, call it Preview and select type returned as:
Number (1,2,3…).
Add the following from here:
or from here:
="<DIV><a href='..\"&Title&".pdf' class='screenshot' rel='..\"&Title&".pdf' ><img border='0' src='/_layouts/images/MAGNIFY.GIF' alt='' style='padding-right: 5px; padding-left: 5px; vertical-align:bottom'></a></DIV>"
That’s it! Now hover over the magnifying glass image and you should see the PDF thumbnail display.
Any questions or comments, post it below. Thanks for reading.

Hide Ribbon from Users with Read Permissions

Hiding the ribbon depending on users permissions.

Read access will hide the ribbon so it will behave like an anonymous user navigating to the site.

Open up your custom master Page in SP Designer 2010.

1. Add a display:none style to the s4-ribbonrow element so it looks like the below code

<div id=”s4-ribbonrow” class=”s4-pr s4-ribbonrowhidetitle” style=”display:none”>

2. add the below snippet inbetween the s4-ribboncont and the s4-ribbonrow Div

<Sharepoint:SPSecurityTrimmedControl runat=”server” Permissions=”ManageLists”>
<script type=”text/javascript”> document.getElementById(“s4-ribbonrow”).style.display = “block”;</script>

3. Close the control by adding the below snippet just above the the s4-ribboncont and the s4-ribbonrow Div


Your code should look like this:

<div id="s4-ribbonrow" style="display: none">

<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="ManageLists">

<script type="text/javascript"> document.getElementById("s4-ribbonrow").style.display = "block";</script>



I have only tested this in SharePoint 2010 as I do not use SharePoint 2013.

I copied this from s SharePoint Design course I participated in with

For other useful tips, check out their Blog Posts:

Record Search Results Queries to a List using a Hit Counter

This is how I am using a Search Results page to record individual Users Search Queries in a list.  Each Search Query is displayed as how the user typed them in.

What I’ll explain is how we can grab the URL from the Search Results and strip out the unnecessary code to display only the User’s Search Query.

For Example

This Search Result URL:


Will be converted to display only what the user has typed in the Search Box, which in this example, is: “pdf“.

Each time a user types in a Search, their query is recorded with their name, date and keywords typed.

Firstly, you need to install and configure the “Hit-Counter and Star-rating for SharePoint” from Alexander’s SharePoint JavaScripts site.

Once you have this configured it and you can see the users data added to the  HitCounter List , we can now modify the HitCounterAndStarRatingForSharePoint.js file to include the Users keywords entered.

1: First create a new column within the HitCounter list call it UserKeywords.  Add this column to your default view.

2: Edit the HitCounterAndStarRatingForSharePoint.js  and scroll down to about line 218:  //Add item.  Within that block of code you will see the column variables, make a new line under ReferringURL:refURL, and type in the new column name which is attached to the variable as such:


3:  Then under the following code at about Line: 152

// Get url and referrer
refURL = document.referrer;

Add the following lines of code:

searchURL =;                               //returns string ?k=Users%20Search%20String
  modURL = searchURL.substring(3);                                   //removes characters ?k= from string
  decodedURL = decodeURIComponent(modURL);       //decode URL to translate encoded characters from string
  searchQuery = decodedURL.split('&')[0];                         //removes characters all after &

Each line I’ve added a comment that describes what each line does.  I don’t know how to write code in Javascript, so I had to Google Search each line to work out how to accomplish each Javascript function.

4:  Now you can test the Search Results page by entering in a Search Query and then checking the HitCounter List.

The UserKeywords column will now display the Search Keywords exactly how they are typed by the user.

Any questions, please comment below, thanks for reading.

Open all PDF files in Maximum Dialog Box

This code grabs any PDF file on the page and rather have them opening in the same window or a new window, they open conveniently in a SharePoint modal pop up dialog window.

All you need to do is:

1: Place the code below into a TXT or HTML file,

2: Upload it to a Document Library

3: Your could edit the file and change the path of JQuery to a local copy of JQuery1.9.1.min.js if required.

4: You could either reference the file path in a Content Editor Web Part.  eg: \sharepointserver\sites\sitecollection\subsite\scripts\pdfmaxdialogcode.html

or add the code to your Master Page in a .JS file . (Need help with this, post a comment below)

5: Open up a page where PDF files are located and test it out.

Fullscreen SharePoint Dialog

To see a preview of the result, refer to my previous post:

This script was created by Alexander Bautz from

His post is located here:

For redundancy, I’ll post the code here as well.

* After you Paste the code, you will need to remove the < code > < / code > tags from the script below, it’s the only way I can paste the code in WordPress without the Object tags being stripped out.
<!-- Put this code below the list view web part -->
<script type="text/javascript" src="//"></script>
<script type="text/javascript">
function openPDFinDlg(href){
var o;
$("body").append("<div id='pdfTemp' style='min-height:600px;min-width:800px;height:100%;overflow:hidden'><<code>object</code> data='"+href+"' width='100%' height='100%' type='application/pdf' ></<code>object</code>></div>");
o = {};
o.html = $("#pdfTemp")[0];
o.showMaximized = true;
o.title = href.substring(href.lastIndexOf("/")+1);
o.dialogReturnValueCallback = openPDFinDlgCallback;

function openPDFinDlgCallback(){
// do something here when the dialog closes
// ]]></script>

To enhance the display of PDF files to your site vistors

When dealing with PDF files, you can also add parameters from Adobe’s PDF Open Parameters documentation to the +href+ variable to present the PDF to your users.

Some examples of Adobe PDF Open Parameters:

The following table lists and describes the available PDF open parameters. Italics indicate user-specified variables.

Specifies a numbered page in the document, using an integer value. The document’s first page has a pagenum value of 1.

Use the page command before this command.
pagemode=none (default)
Displays bookmarks or thumbnails.
Turns scrollbars on or off.
Turns the toolbar on or off.
Turns the status bar on or off.
Turns the document message bar on or off.
Turns the navigation panes and tabs on or off.

for example: Within line 11, you can change this portion:

 data='"+href+"' width='100%' height='100%' type='application/pdf' 

to this

 data='"+href+"#page=1&view=fitV&pagemode=thumbs' width='100%' height='100%' type='application/pdf' 

For further documentation on Adobe Open Parameters see this link:

* Possible issues: If the PDF link is located outside of your SharePoint server, the dialog window will display but the PDF may not.

Hope the code is useful for your site, thanks for reading.

Reply to Discussion: Send Email to Item Owner using Workflow

After a few Google Searches, I finally found how to Send an Email, using SharePoint 2010 Designer Workflow, to the Original Creator of a Discussion Item when someone posts a reply to the discussion item.

Here is the original URL I used for the instructions:

“I learned that discussions have two different content types, Discussion for a new topic posted and Message for a reply to that topic.

The ID for the original discussion (topic) post is the column “ID” on that item. But the reply messages store this same number in the “Parent Folder ID” column.

So, I created a workflow with one condition, that the content type is Message. When the condition is met (only by replies), I send an email with the To field populated by: “Workflow Lookup for a User”, with the data source as the Current List, the Field from source as Created by and the Return field as Email Address.

Under Find the List Item, the column is ID and the Value is Current Item:Parent Folder ID. Then fill in the body of the email with whatever data you need.”


Note:  Condition – “Current Item Content Type equals Message  (You’ll have to type in the word “Message”)

For the Action, just follow the picture that shows the correct way of determining the Originator of the Discussion Item.

For the Body, you could add a direct URL to the Discussion List Item from the following Blog Page:

Ask if anything is unclear. Thanks for reading.

Using Javascript URL in Calculated Columns

If you’re looking at using Javascript in a calculated column to call a URL, here’s a method that’s quick and simple to apply.

I found that when I attempted to run this inside a calculated column, the javascript url path removes the ” ” and therefore won’t run.

HTML Example of URL

<a onclick='javascript:openDialog("/server/site/CSSdocument.pdf");javascript:return false;' href="#" target=_self>

<img src="/server/site/CSS_Page_001.jpg" alt="" ></a>

So you could run the html inside a html file linked to the Content Editor Web Part first to make sure your Javascript works on the page, then add the Custom List with the calculated column below.


First, create two ‘single line of text’ columns, each containing the following text as default value




");javascript:return false;'

Then, I have two versions of syntax you can use. Make sure you change “The data type returned from this formula is:” to Number (1, 1.0, 100)  This will convert your column to html.

Calculated Column Version 1

="<a "&jscript1&""&FileName&""&jscript2&" href='#' title='Title' target='_self'><img src='"&Thumbnail&"' alt=''></a>"

Calculated Column Version 2

=CONCATENATE("<DIV><a ",jscript1,"",FileName,"",jscript2," href='#' title='book' target='_self'><img src='",Thumbnail,"' alt=''></a></DIV>")

So from the examples above, each “jscript” column will be replaced with it’s code and which will use the “FileName” column as it’s URL.

It’s not as Dynamic as I would like, so this would suit a Site Owner who familiar with Javascript.

Any questions if it doesn’t work and would like assistance, please comment below.