sp24 my site_branding

Post on 08-May-2015

319 Views

Category:

Internet

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

How to brand MySite and how to provision branding to personal MySite on Office 365 I won't show you the code, but I'll use MySiteBranding web part as example of what does it take to provision the custom master page and theme to personal MySite site collection for each user. The code that provisions the master page is written in JavaScript. MySiteBranding app is a SharePoint hosted app that is available for purchase at Office App Store. The MySiteBranding app and web part are installed on MySite host, the code provisions the master page to another site collection - to personal MySite.

TRANSCRIPT

MySite, Branding

Sonja MadsenDenmark, GMT+1:00April 16th /17th, 2014

Developer/Architect/Consultant

10 years with SharePoint

SharePoint MVP

Speaker

Microsoft partner and vendor

Sonja MadsenOwnerSONJASAPPSCopenhagenDenmark

Contact

@sonjamadsendev@sonjasapps.comSp2013.blogspot.com

Set custom theme and master page to MySite Host Provision custom theme and master page to personal MySite

MySite, Branding

MySite Host: Set theme and custom master page

Personal MySite: Provisioning theme

and custom master page

MySite, Branding

”About me” is the key page

Tags And Notes

About meIntranet

Title: MySite Personal Upgrade On NavigationDescription: Creates or upgrades a user's personal site upon navigation to the My Site Host site.

”About me” is a key page

Hidden web part

Out-of-box SharePoint – Best Practice

Answer: Hidden web part

JavaScript (ADFS, Hosting) = No prompt from hidden web part

How to provision master page and theme

What to do first?

About meIntranet

Tags And Notes

Set custom theme and master page

Provision custom theme and master page

MySite Branding Plan

About me

Tags And Notes

Hidden links in Site Settings

Links are hidden, pages are still available

MySite Host

1. Apply theme 2. Apply custom master page on MySite Host

One down, one to go.

Half way through!

Yess!!!

Users with READ access to MySite Host have FULL CONTROL access to their personal MySite

Personal MySite is another site collection

When do we want to apply branding

Code:Get custom master page and custom theme that are applied to MySite Host, or hardcode the valuesGet current user and personal MySite url, or hardcode the valuesCopy the custom master page and theme to personal MySiteApply theme Apply custom master page

Provisioning: What do we need to know

Most Users have READ access to MySite Host Is that a problem? Get current user Get current master page url Get current theme url Get current master page file Get current color palette and font scheme file

When to apply branding

var value = SP.Web.get_customMasterUrl ()

http://<sitecollection>/<site>/_api/web/customMasterUrl

var value = SP.Web.get_masterUrl ()

http://<sitecollection>/<site>/_api/web/masterUrl

var value = SP.Web.get_themeInfo ()

http://<sitecollection>/<site>/_api/web/themeInfo

Get custom master page and custom theme that are applied to MySite Host

var targetUser = SP.Web.get_currentUser ()

http://<sitecollection>/<site>/_api/web/currentUser

var peopleManager = new SP.UserProfiles.PeopleManager(clientContext);

personProperties = SP.UserProfiles.PeopleManager.getMyProperties()

/_api/SP.UserProfiles.PeopleManager/GetMyProperties/PersonalUrl

Get current user and personal MySite url

Half way through!

Yess!!!

_api/web/getFileByServerRelativeUrl(themeFile)/$value“

var masterpage = new SP.FileCreationInformation()

getFolderByServerRelativeUrl(relUrl + "_catalogs/masterpage/")

Get and copy the custom master page and theme

SP.Web.applyTheme(colorPaletteUrl, fontSchemeUrl, backgroundImage, true);

SP.Web.set_masterUrl(relUrl + "_catalogs/masterpage/" + filename)

SP.Web.set_customMasterUrl(relUrl + "_catalogs/masterpage/" + filename)

Apply theme and set master page

What about the blog?

What about the hidden web part?

Anything Else?

Get theme

Get master page

When to apply branding

Pitfalls

Pages on MySite

Why do we want to brand MySite

”About me” is a key page

Hidden web part and JavaScript

MySite Host Settings and hidden links

How to get custom theme and master page url

How to get current user and personal site url

How to get and copy the files

Apply theme and set master page

Blog

JavaScript web part

Summary

@sonjamadsen

dev@sonjasapps.com

sp2013.blogspot.com

Sonja Madsen

top related