Promoted Links in SharePoint 2013/2016/Online

This SharePoint tutorial explains Promoted Links App in SharePoint 2013. How to create a promoted link app in SharePoint 2013/2016 or SharePoint Online. Also, we will check how to enable promoted links app in the SharePoint publishing site.

Promoted Links App is a new feature in SharePoint 2013. Promoted Links App is like a list but it has the ability to have a background image with a link and also you have the option to open the link in a separate window. Promoted Links App looks attractive on the page in SharePoint 2013/2016/Online.

Create Promoted Links App in SharePoint

Now we will see how we can add/create a promoted links app into SharePoint 2013/2016/Online. SharePoint provides a template known as “Promote Links“, by using which we can create Promoted Links App.

Open SharePoint Online site, click on the Settings icon on top of the page and then click on Add an App as shown in the fig below.

promoted links in SharePoint 2013

Then from the list of App, select Promoted Links App as shown on the fig below:

promoted links in SharePoint 2016

Then give a name in the Adding Promoted Links page as shown in the fig below:

promoted links SharePoint online

Then go to the home page of the list as shown in the fig below. There click on add new item.

create promoted links in sharepoint 2013

This will open the screen to add an item, here you can put the title, background image, description, link location and the launch behavior (select new tab option if you want to open in a new link window), you can optionally give the order as well. Then click on Save.

create promoted links in sharepoint 2016

Here I have added 3 items to the list. Now go and edit the page and add the list to the home page like below.

create promoted links in sharepoint online

After that it will appear like below:

sharepoint 2013 promoted links

Enable promoted links app in SharePoint publishing site

Now, we will see how to enable promoted links app in SharePoint 2013 publishing site. By default, if you will open a SharePoint 2013 publishing site, you will not be able to see the Discussion Board, Issue Tracking List, promoted links App, etc.

To bring promoted links app in SharePoint 2013, we need to activate the Team collaboration lists feature. Team collaboration lists is a feature that Provides team collaboration capabilities for a site. Once you activate this feature you will able to see: Form Library, Picture Library, Document Library, Announcements, and lists like Calendar, Contacts, Custom List, Custom List with Datasheet View, Promoted Links, Discussion Board, External List, Issue Tracking List, Links, Project List, Survey, Tasks etc.

Activate Team collaboration lists feature

Click on the Settings Icon from the right top and click on Site Settings as shown in the fig below:

enable promoted links in sharepoint 2013

Then click on Manage site features from the Site Actions section as shown in the fig below:

enable promoted links in sharepoint 2016

This will open the list of features, search for Team Collaboration Lists and click on Activate as shown in the fig below:

enable promoted links in sharepoint online

Once the feature activated, you will able to see the above apps in the publishing site.

Create Promoted Links App in SharePoint using PowerShell

Now, let us see how to create promoted links programmatically in SharePoint using PowerShell.

Tiles list is a new list template introduced in SharePoint 2013 to add links with Tiles view. We can create the Tiles List out of the box using Promoted Links which is a simple process as we use any list template while creating a list.

While creating the Tiles List programmatically we have to pass template ID. For Promoted Links the template Id is 170.

The below code has been written in CSOM and Powershell script which will create a promoted links app in SharePoint using PowerShell.

$ListInfo = New-Object Microsoft.SharePoint.Client.ListCreationInformation
$ListInfo.Title = $listName
$ListInfo.Url=$list.Url
$ListInfo.TemplateType = "170"
$ListInfo.TemplateFeatureId="192EFA95-E50C-475e-87AB-361CEDE5DD7F";
$spList = $web.Lists.Add($ListInfo)
$spList.Description = $ListTitle
$spList.Update()

Add Promoted Links web part programmatically in SharePoint

Let us see how to add promoted links web part in the home page using the client object model in SharePoint 2013/2016.

Adding a specific view of the web part is possible in the web part programmatically in SharePoint 2013/2016.

Below are the steps to add the Promoted Links web part programmatically in SharePoint.

First Connect to site page -> Home Page of SharePoint 2013 site then Get web part Manager of the page.

And then Get List from current site, Get Specific view “Tiles” from that List.

Then Change list view to the web part presentation and Load webpart view to context, then Define webpart and webpart properties and Save webpart properties programmatically

Now, Load webpart into HomePage.

Here is the code :

//Get homepage url

String HPUrl = string.Format(“{0}/SitePages/{1}”, web.ServerRelativeUrl, Consts.NEWHOMEPAGENAME);

File page = web.GetFileByServerRelativeUrl(HPUrl);

//get the web part manager
LimitedWebPartManager wpm = page.GetLimitedWebPartManager(PersonalizationScope.Shared);

//Add the webpart
Site s = ((ClientContext)(web.Context)).Site;
web.Context.Load(s);
web.Context.ExecuteQuery();
foreach (string promotedLinksTitle in Consts.PROMOTEDLINKSTITLES.Reverse())

{
//get promoted links list
List promotedlinks = web.Lists.GetByTitle(promotedLinksTitle);
web.Context.Load(promotedlinks);
web.Context.ExecuteQuery();

//Get Tiles view of the promoted links list
web.Context.Load(promotedlinks.Views);
web.Context.ExecuteQuery();
View tilesView = promotedlinks.Views.ToList().Find(p => p.Title == “Tiles”);

if (tilesView != null)
{
//Get page of the view
File pageTilesView = web.GetFileByServerRelativeUrl(tilesView.ServerRelativeUrl);

web.Context.Load(pageTilesView);
web.Context.ExecuteQuery();

//Get webpartManager of the page
LimitedWebPartManager wpmView = pageTilesView.GetLimitedWebPartManager(PersonalizationScope.Shared);

web.Context.Load(wpmView);
web.Context.ExecuteQuery();

//Get Tiles webpart
web.Context.Load(wpmView.WebParts);

web.Context.ExecuteQuery();
List<WebPartDefinition> viewWebPartDefs = wpmView.WebParts.ToList();
WebPartDefinition webpartDef = viewWebPartDefs.First();//Only one webpart definition is available
web.Context.Load(webpartDef.WebPart);
web.Context.ExecuteQuery();

//Add a copy of the webpart in Home Page
WebPartDefinition addedWebPartDef = wpm.AddWebPart(webpartDef.WebPart, “Body”, 0);

web.Context.ExecuteQuery();

//Open the webpart definition for changes
addedWebPartDef.OpenWebPart();

web.Context.ExecuteQuery();

//Load webpart
web.Context.Load(addedWebPartDef.WebPart);

web.Context.ExecuteQuery();
web.Context.Load(addedWebPartDef.WebPart.Properties);
web.Context.ExecuteQuery();

//Define hidden chrome type
addedWebPartDef.WebPart.Properties[“ChromeType”] = System.Web.UI.WebControls.WebParts.PartChromeType.None;

//Save changes of the webpart definition
addedWebPartDef.SaveWebPartChanges();

web.Context.ExecuteQuery();
//Close webpart definition previously opened
addedWebPartDef.CloseWebPart();
web.Context.ExecuteQuery();
}
}

This is how to add the Promoted Links web part programmatically in SharePoint 2013/2016.

You may like following SharePoint tutorials:

Here I have explained what is a promoted links app in SharePoint 2013. How we can add a promoted links app in SharePoint Online or SharePoint 2013/2016. Also, we learned how to enable promoted links app in SharePoint 2013 publishing site.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>