Office 365 & PNP PowerShell 2013 : Branding Part1

Last post we have learned about the other branding topics as mentioned below. 

1. Create the bulk custom Actions using CSV files. 
2. Set the Home page URL using CSV file. 
3. Add and remove the script blocks and script links. 

Now this post we will learn how we can create the bulk links using "Add‑PnPNavigationNode" method. So in this example I am going to create the utility that help you to create the multiple links in the single go. For this we will be using the csv files for configure every thing. As you know using this method you can add the links to following locations. 



1. TopNavigatoin



 2. QuickLunch

 3. SearchNav


So here is the solution without taking your much of time. 


Remove the Navigation using "Remove‑PnPNavigationNode"
We have learned how to add the navigation, now the question come if we need to delete the same above created structured. 

So friends, I am facing very taught time to make this possible. So I am not able to delete the links when there are parent child relationship the same as we have in the above example. 

So this example working fine. 

Add-PnPNavigationNode -Title "hello" -Url "http://test-dev.com/sites/test1" -Location QuickLaunch -External:$true -First:$true

Add-PnPNavigationNode -Title "hello1" -Url " http://test-dev.com/sites/test1" -Header "hello" -Location QuickLaunch -External:$true -First:$true


To Remove the links 

Remove-PnPNavigationNode -Title "hello" -Header "hello1" -Location QuickLaunch -Force -ErrorAction Stop #This will remove only the "Hello"

Remove-PnPNavigationNode -Title "hello" -Location QuickLaunch -Force -ErrorAction Stop #This will remove the both "hello" and child "hello1" 



So I tired and created the same csv solution as well. The most common error encounter many time. 

"Sequence contains more than one matching element"

So here is the solution, if you can fix this issue please share your comments with me. 


Working with Responsive UI

To make your SharePoint site responsive for both Microsoft SharePoint 2013/2016 on-premises or SharePoint Online using the PowerShell cmdlet Enable-PnPResponsiveUI, and also provides you the capability to enable a custom Responsive UI for a Site Collection. 

First the solution built externally (link). Now this is the part of the SharePoint PNP Framework. 

The Responsive UI is applied to the following pages of the root site of a Site Collection, as well as of any sub-site (as long as you disable the "Mobile Browser View" feature in any specific sub-site):

  • Home Page
  • Web Part Pages
  • Wiki Pages
  • Document Libraries
  • Lists
  • Site Contents
  • Site Settings
There are two command reponsible for enable and disable the Responsive UI. 

Mobile Responsive views screenshots taken from Github. 



Working with Themes
Get‑PnPTheme and Set‑PnPTheme Cmdlets are set and get the sharepoint theme. 

Frankly speaking I am not big fan of this Theme engine, but you can check this blog post how to create custom themes "http://www.learningsharepoint.com/2013/06/03/create-custom-theme-in-sharepoint-2013-step-by-step-tutorial/". Once you done you can upload it and and set the Theme via Set‑PnPTheme

Comments

Popular posts from this blog

SharePoint RPC Protocols Examples Using OWSSVR.DLL

Send Email using SharePoint Rest API

Query suggestions in SP 2013 Using Rest API (/_api/search/suggest)