Tag Archives: SharePoint

How to stop using custom master pages when branding SharePoint



With the rise of Office 365 and SharePoint online, the ancient practice of using a custom master page to brand a SharePoint site is coming to an end. SharePoint online has many incremental changes, bug fixes and improvements to the Seattle master page meaning that if you have taken a copy of this Master Page to apply your branding, you could be missing out on the constant evolution of SharePoint online.

Custom Master Pages can still be used but Microsoft recommend against this now. The good news is that we can make exactly the same branding changes without having to use a custom master page.

I will briefly mention that you can create themes for SharePoint very quickly using Microsoft’s free tool which can be downloaded from here. Great for quick colour palettes and background images but not great if you want a responsive or more custom design.

Custom master pages (for branding purposes) tended to have a small number of adjustments such as:

  • Custom HTML (maybe for a menu container)
  • Links to CSS files (for responsive styling and branding)
  • Links to JavaScript files (for use of jQuery and additional libraries)

Link to custom CSS file

A link to a custom CSS file is recommended for advanced branding changes. This won’t affect any improvements to the default Seattle master page however you may need to update the CSS from time to time to reflect any interface changes. The alternative CSS link can be set via the GUI on a publishing site or by CSOM on any site.

As a designer, you will be aware that you can’t do everything in CSS such as placeholders for menus or other interactive content or run JavaScript.

Inject JavaScript

JavaScript and HTML plays a big role in most branding exercises. It could be DOM manipulation, a responsive menu, sliding effects or responsive background slideshows and JavaScript tends to be a requirement on most projects. Luckily there is some more good news, JavaScript can be added to a site without editing the Master Page by adding custom actions.

You should already be storing JavaScript in external files (in the Style Library) rather than embedding on the master page. So the only change is to inject these JavaScript files rather than reference them on the MasterPage. This can be done via CSOM (I use the PowerShell method).

#Run all of your lines to load the context of the site collection
$context.Load($site)

#add custom js injection action
$customJSAction = $site.UsercustomJSActions.Add();
$customJSAction.Location = “ScriptLink”;
#reference to JS file
$customJSAction.ScriptSrc = “~SiteCollection/Style Library/JS Display Templates/test.js”;
#load it last
$customJSAction.Sequence = 1000;
#make the changes
$customJSAction.Update();
$context.ExecuteQuery();

You can use the same objects to remove all the custom actions and list them. You can find out more information and the C# examples here.

Conclusion

Although this is a different way of thinking about branding, in the long run, it’s cleaner and more reusable than custom master pages. Your customers will have a better experience in Office 365 but even CSS and DOM manipulation may need updating as SharePoint evolves.

Some really useful examples and more detailed explanations can be found on Vesa Juvonen’s Ignite talk. In Vesa’s example he uses Visual Studio and Apps to deploy the CSS and JS.

In the video at the top of the post, I quickly go through the process of setting alternative CSS and JavaScript custom actions.

Using the SharePoint recycle bin

I’m often asked about restoring deleted documents, where the recycle bins are and how long they are kept there for. Hope this post will be of use to some of you.

SharePoint’s powerful document management features provide the end user and administrator ways of recovering deleted items. Items can be deleted accidentally (sometimes without the end user even knowing). Luckily we can go into SharePoint and recover the document before it is lost forever.

Two stage recovery

When a document is first deleted, it goes into the end user recycle bin on the site. The user deleting the item has several days (93 days by default in SharePoint Online) to recover the item themselves.

After that period (or if the item is deleted from the site recycle bin) it then goes into the second-stage recycle bin. The second-stage recycle bin is only accessible by the site collection administrator. There is then another 93 days to recover the item before it is deleted forever! Items in the second-stage recycle bin don’t count towards your site collection quota but items will automatically be deleted if you exceed 200% of your site collection quota (which is unlikely if you make sure your site collection has 1TB of storage).

I’ve created the video below to explain the recovery process from both recycle bins. A great way to find those missing documents which were accidentally deleted by the end user.



More information can be found here on the Microsoft website.

Setting up Azure Connect (DirSync) for Office 365

I’ve made a quick video guide on how to set-up Azure Connect (DirSync) to sync with Office 365. It’s done using a simple demo environment and I suspect that you may find complications and other errors when trying this out in a production live environment. Hopefully this is of use to you (even if it just makes it seem less scary!). I will try to get chance to write up this blog post in more detail rather than just the video at some point in the future.



Using PowerShell to find last DirSync

When troubleshooting DirSync issues with Office 365, it is sometimes difficult to know if the DirSync successfully applied to Office 365.

There is a quick way to check this and it provides the data for when the update last took place. First you will need to make sure that you have installed the Azure AD Module for PowerShell, you can download from here.

When this has installed, run Connect-MsolService to connect to the Office 365 tenancy, this should be a global administrator account.

Azure Connect PowerShell

Then run Get-MsolCompanyInformation to get the tenancy information which includes the last dirsync time and last password sync



How to embed a Twitter widget on a SharePoint page

Many schools and businesses are using twitter as a social communication platform to send out news and information to users. How to embed twitter feeds on SharePoint intranets and public sites has been a popular question recently so thought I would share with you how it is done. I’ve also created a video guide on YouTube to talk through the process.

First login to your twitter account in a browser on a desktop computer (it doesn’t have to be the same account as the one that you want to display in your widget).

Click on your profile picture in the top right of the screen and select “Settings” from the drop down menu.

Twitter

Select “Widgets” from the left side menu.

Twitter

Create a new widget.

Twitter

Choose your design and configuration. More options are available via the customisation documentation link on the page. Click “Create Widget” to generate the code.

Twitter

Copy and paste the code into a Script Editor web part. The Script Editor web part can be found under the “Media and Content” category.

Twitter

I go through the process in more detail in the video below. Hope you find it useful. For SharePoint support and consultancy please contact me at Cloud Design Box.



How to render display template on a list view

This blog post is a bit more technical than my previous entries. Just recently, I was required to show two different views of a list on the same page (both styled with JS Display Templates). It’s relatively straight forward when you know how to quickly get the view GUID from the web part.

JS Display template only applying to one web part

You may have seen in other posts that you can get the GUID of a view by going to the edit view page and grabbing it from the URL encoded string. However this doesn’t always work for web parts added to the page as they tend to get thier own unique “current view”.

There is a really easy and quick way of finding this GUID using an alert in your JavaScript Display Template. When you are working with the current list object, in my example below “ctx”, you can get the view GUID from this object by calling “ctx.view”. Wrap that up in an alert and the alerts will render from top to bottom on the page and display each web part view GUID.

alert(ctx.view);

Once you have the GUID, use another if statement in your code to set the base view id. Now your JavaScript only applies to that one view for the list.

if (ctx.view === "{07BC665B-0274-42D2-97BF-8EBEA8B72436}") {
	//Override the BaseViewID if it's the one we want.
	ctx.BaseViewID = 722;                
}


Class site templates in SharePoint

As part of my work for Cloud Design Box, I have been working on class templates for student and teacher collaboration in SharePoint. My templates are using lots of display templates and are provisioned automatically from MIS data using the Salamander provisioning tools. Each template combines, out-of-the-box lists and libraries with custom content types, search web parts and JavaScript display templates. It’s available in both SharePoint on-premises and SharePoint Online. The video below goes through some of the features available for the class sites. Each class template is customised on a per school basis with a responsive design so that it will work on all devices.

For more information or an online demo, contact me by clicking here.



Creating a simple SharePoint Workflow to send an email

I have made the video below on how to create a basic SharePoint workflow to send emails. This could be used for sending out remittance advice (like in the example below) but it could also be used with additional workflow logic for sending out help desk emails, renewal reminders, etc.

Hope you find it useful, please feel free to contact me at Cloud Design Box if you have any further questions. I’ll try and make a full blog post on this subject with screenshots as soon as I get chance.



Adding a custom tile to the app launcher in Office 365



The Office 365 app launcher is a great way of getting easy access to single sign-on applications within Office 365 and externally. Recently Microsoft introduced some functionality to allow users to add thier own links to the app launcher. This is a great way of quickly getting to a particular link.

To add a new tile, you will need to create an image for the background of the tile. Ideally you want this to be a white image with a transparent background saved as a PNG. This keeps it in line with the app launcher style and the transparency shows the tile colour behind the background image. This should be a small and compressed image to keep the load time to a minimum.

The tile image is best hosted in a SharePoint picture library, make a note of the absolute link to the picture as you will require this when adding the custom tile.

In the Office 365 Admin interface, select the “Organisation Name (Edit)” link in the top right corner.

Organisation edit link

In the left menu, select “Custom tiles” and then click on the plus button to add a new link.

Add custom tile

Enter a name, url (where you want the tile to send users), description and Image Url (from the image stored in the SharePoint picture library).

Enter tile details

Press Save. The new tile will still not appear in the app launcher, however it is now available to add by clicking on “my apps” at the bottom of the app launcher.

my apps link

Select “Pin to app launcher” from the menu next to the new custom tile.

pin to app launcher

The new custom tile is now added to the app launcher.

Office 365 App Launcher

This is a great way to add a quick link to your SharePoint site collections without having to go throught the “Sites” page each time.

Please note that this method only adds the custom tile to the app launcher for the currently logged in user, not all users in the organisation. At the present time there isn’t an option to do this.

Using SharePoint Groups

What is a SharePoint group?

A SharePoint group is a group of users which can be used to permission a site. Groups can be re-used around the site collection and can be used to permission, sites, lists, libraries, folders and items. Using SharePoint groups allows the administrator to control access without having to edit individual permissions, only the SharePoint group membership requires editing rather than each permission level.

Creating a SharePoint Group

Select “Site settings” from the SharePoint menu.

SharePoint Group Permissions

Select “People and Groups” from the “Users and Permissions” menu.

SharePoint Group Permissions

Select “Groups” on the left side menu, this will show a list of all the groups on the site collection.

SharePoint Group Permissions

Create a new group by selecting “New Group” from the “New” drop down menu.

SharePoint Group Permissions

Enter a name and description for the new group.

SharePoint Group Permissions

The Group owner has overall control of the group settings and members. This is usually either an administrator or someone you have delegated the running of the group to.

SharePoint Group Permissions

You can decide to keep the membership of the group private to the users in the group or let everyone see the group membership. There is also an option to allow group members to edit the membership of a group. This is great for collaborative sites where members may wish to share with others without having to go to the group owner. It helps remove some of the burden from the group owner and can open up sharing and collaboration without admin intervention.

SharePoint Group Permissions

Membership requests allow users who are not members of the group, the ability to request membership. This can be set to auto-accept which is useful for open groups or the requests can be sent to an email address for approval by the group owner (or members if this option was enabled earlier).

SharePoint Group Permissions

Permission levels can be set when creating the group. Please note that setting permissions here will only apply to the site which you are currently on. It is advised that you create the group without any permissions and then go back into the sites to add relevant permissions to avoid any confusion.

Click “Create” to finish setting up the group.

Adding members to the group

Once the group has been created, you may notice that the only member is the group owner. Additional users can be added by going to the “Add Users” option under the “New” menu.

SharePoint Group Permissions

Enter the name(s) of the members(s) you wish you add to the group. Under advanced options, you will see that the default setting is to send an email to any users added to the group. This is optional and can be deselected. In addition to this, you can customise the personal message in the email invitation for these users.

Note: Active Directory security groups can also be added here if using DirSync (in Office 365)

SharePoint Group Permissions

Click Share to add the users to the group.

Permissioning a site with a SharePoint Group

Once the group has been created, it can be used to permission subsites, lists, libraries, folders and even items. To give the group’s members permissions on a SharePoint site, first navigate to the SharePoint site itself.

Select “Site Settings” from the menu.

SharePoint Group Permissions

Select “Site permissions” from the “Users and Permissions” menu.

SharePoint Group Permissions

Select “Grant Permissions” from the “Permissions” tab.

SharePoint Group Permissions

As you start to type in the name of the group, SharePoint will pick up the group name.

SharePoint Group Permissions

Click “SHOW OPTIONS” to view the permission levels.

Select a permission level from the drop down and decide whether you would like to send an email to the group.

SharePoint Group Permissions

Avoid adding the group to another SharePoint group (this is usually the default option and can over complicate your permissions). Use one of the permission levels available:

  • Read – Can view the site but cannot edit any items or pages
  • Contribute – Can add, edit and delete list items. User cannot create new apps or sites.
  • Design – Users have contribute but in addition, they can also create and delete apps and subsites. Apply themes and designs.
  • Full Control – Users can do anything on the site including change permissions (usually admins only)

There are other permission levels, you can also specify your own. For a full reference of permission levels please see the Microsoft site:

Microsoft Office 365 Support – Permissions