Archives For November 30, 1999


The SharePoint 2013 My Site has a neat new feature of aggregating all of your tasks and allowing you to complete a task with a single click, no matter where the task resides. This eliminates the need for the assignee to go to all of his/her team sites and update their tasks. However, in certain scenarios, the my site and OneDrive experience has not been fully adopted. So, I decided to write a display template that could utilize CBS (Content By Search) web part to rollup all tasks. The display template also allows you to mark the task completed, launch in a modal, and asynchronously update. Let’s get started.

Summary

Here is what the web part will look like when we finish.

image

Continue Reading…


When you use the promoted links app in SharePoint 2013 you will notice that the default behavior is to run the tiles off the right of the screen and show paging buttons(below) image

This is because the CSS class ms-promlink-body is set to a width of 10000px. Not sure why they did this but there is a quick fix for it.

Option #1 – Recommended

Add the following override to your style sheet.

.ms-promlink-body {
max-width:100%;
}

.ms-promlink-headerNav{
display: none;
}

Note: This will affect all promoted links apps.

Option #2 – Script Editor

  1. Go to your Tiles.aspx view for your promoted links list.
  2. Select the Gear –> Edit Page
  3. Add a script editor web part to the page.
  4. Add the code snippet below to fix the width.

<style type=”text/css”>

.ms-promlink-body {
max-width:100%;
}
.ms-promlink-headerNav {
display: none;
}
</style>

Note: This will only affect the current promoted links app.

Important: Because we are adding a web part to a default list view page SharePoint treats this as a modified application page. Due to this, when we view the page the Item/List tabs are missing. To get them to show we must click inside the List(Tile) view web part to activate the button in the ribbon. This can be done by clicking on some white-space within the actual web part.

Result:

image

 

{Kam}


A new feature of 2013 are the metro-style tiles. Every new team site has them as a banner on the homepage.

image

To create your own tiles you are limited to the promoted links app or the Announcement Tiles feature. I wanted the ability to use the tiles in my search results and other areas as needed. I have two display templates that will allow you to do just that, with any type of content within SharePoint. The solution consists of 3 parts:

  • Display Template
  • JavaScript file (Used for moving panel on mouse-over events)
  • CSS file for rendering the tile correctly.

 

Let’s get started…..

First we need to get our code and place them in their respective areas. Attached you will find the 3 files needed for this display template:

    • Item_HorizontalTiles.html
    • Item_VeritcalTiles.html
    • Tiles.css
    • Tiles.js

The item templates (Veritcal/Horizontal) need to be placed in your site collection display templates folder. The path is _Catalogs/masterpage/Display Templates/Content Web Parts/. The easiest way to do this, if you are not familiar with display templates is using the Designer manager via the site gear. When you drop these files SharePoint will automatically create a linked <name>.js file. This file contains all the JavaScript that is outlined in the display template.

Next, we need to place our CSS and JS files. I have placed mine in the /Style Library/CSS and /Style Library/JS respectively. You don’t have to place the files in this location. However, if you choose to put them somewhere else you will need to update the $includeScript and $includeCSS path in the display template HTML file.

 

Information about the template

The template renders a tile similar to one you use with promoted links and announcements tiles. It allows to you to map the following fields:

    • LinkURL (Auto Do Not Change)
    • PictureURL (Automatically pulls the most common managed properties for images)
    • Title (Title of the tile – First Line)
    • Description (Description of the tile – Second line onmouseover)

These fields can be mapped using the Content By Search web part when the display template is selected (See below)

image

As you can see I am setting this first search to return people:

image image

 

We could also change our query to return documents:

image        image

 

We could show announcements:

image image

Note: If you just added the ‘Rollup Image’ column to your announcements, the tile would show your image on the tile as well.

 

We can show article pages:

image image

You also choose to arrange these vertically using the Item_VerticalTile display template called “Vertical Tile” in the web part property selector.

image

 

As you can see, with the tile we can view any type of content we want. The HTML display template is easy enough to tailor this to any specific need or specific content that you would like. It is not necessarily a one-size-fits-all but it is a good start.

Source Files: https://github.com/kameronberget/SharePointPhiles

{Kam}