Display Templates: Forcing Office Docs to Open in Browser

christineSharePoint, Templates & DownloadsLeave a Comment

When you’re using Content Search web parts to display documents, depending on your configuration, Office files will download instead of opening in the browser when clicked. Here’s a Javascript snippet you can add to your display template to prevent this behavior and force them to open in a browser: var ext = linkURL.toString().slice(-3); switch(ext) {      case ‘ocx’:      case ‘doc’: … Read More

Displaying SharePoint Views with Content Search Parts

christineAdministrator Guides, SharePoint, Templates & DownloadsLeave a Comment

SharePoint keeps track of the number of views for documents, sites, and pages, and you can display this information with Content Search Web Parts (CSWP). You can use the out-of-box “Two Lines” display template to display this, but that’ll just give you the document titles and a number for the page views (unlabeled). I created a display template based off … Read More

How to Vertically Align List Item Text

christineAdministrator Guides, SharePoint, Templates & DownloadsLeave a Comment

Have you ever noticed that when you add multiple lines of text columns to a list view that the formatting gets a little wonky? If you’d like to get your text all aligned and centered (say with photo thumbnails), paste this CSS into a hidden content editor web part on the page: <style> .ms-vb, .ms-vb2, .ms-vb-user, .ms-vb-tall, .ms-pb, .ms-pb-selected { … Read More

Color-Coding a SharePoint List Without Javascript

christineAdministrator Guides, SharePoint, Templates & DownloadsLeave a Comment

color-coded-list-sharepoint

I’ve tried following quite a few tutorials for color-coding that use Javascript (such as this one), but couldn’t get a single one to work in SharePoint Online. As a workaround, I made my own color-coding method using a concatenate formula in a calculated column. How it Works Calculated columns in SharePoint that have the type “number” can render HTML via a concatenate formula. … Read More