Category Archives: Content Types

How to create a basic content type

I’ve just created a video guide on creating a simple content type and attaching it to a document library.

You can add custom metadata to a SharePoint list by:

  • Adding columns directly onto the list
  • Using Site Columns (can be reused with other lists)
  • Content Types (can be reused and keeps a set of custom columns together in a content type)

If you decide to use a content type, you will also get the benefits of being able to apply a workflow to the content type (rather than to each list individually). If you are thinking of developing search, content types can be a great way to filter and search for specific types of data in a list. You can also use multiple content types in a list (each with different columns), for example an invoice and a receipt.



How to add the content query web part to a page layout in SharePoint 2013 and SharePoint Online

Content queries in page layouts can be quite useful when wanting to generate your own navigation based on page content type. There isn’t a straight forward way to adding these into your current page layouts so I thought it would be useful to share this method.

Open Design Manager from the menu.

SharePoint menu

Select “Edit Page Layouts” and create a new temporary page layout (as shown below).

SharePoint Design Manager

Select “Conversion successful” to go to the preview page. In the top right select “Snippets” to open up the snippet code generator.

Code Snippet

Select “Other Web Parts” drop down menu and click “Content Query”.

Content Query

Configure the web part including the appearance, title and queries. Select the update button to generate the custom code.

Web Part Properties

Copy the custom code generated, this code needs to be pasted into the HTML version of the temporary page layout via SharePoint Designer 2013. Once this code has been copied into the page layout HTML, in this case testttt.html, save the file.

SharePoint will then automatically convert this code to aspx in the file testttt.aspx. Open this file to grab the content query code which can be used in any page layout.

Page layout with content query

Of course you can use the design manager to create your actual page layout (rather than just using it to convert code) but many people find this restrictive and already have good page layouts ready to deploy.

If you require any help or training, check out my consultancy company Cloud Design Box which provides this and other services for SharePoint on-premises and Office 365.