Composed looks are stored as items in the _catalogs/design
list within each SharePoint site. They can specify the master page, color palette, font scheme, background image, and display order in relation to other composed looks.
Follow these steps to create a custom composed look:
Composed looks are simply stored as items in the _catalogs/design
list. When a composed look is applied to a site the items specified in the composed look are used to create a SPTheme
object that then gets applied to the SPWeb
object representing the site. If no background image is specified, none will be applied when using this composed look. If no font scheme is specified, the default SharePointPersonality.spfont
font scheme will be applied when using this composed look.
Lastly, the Display Order option is used to sort the available composed looks when choosing which composed look to apply to a site. Have a look at the following screenshot:
A composed look can be created with PowerShell or code using the server-side object model.
Follow these steps to create a custom composed look using PowerShell:
Get-SPWeb
Cmdlet:$web = Get-SPWeb http://sharepoint/site
SPList
object representing the _catalogs/design
list from the SPWeb
object:$list = $web.Lists["Composed Looks"]
SPListItem
to the Items
collection of the SPList
object:$item = $list.Items.Add()
SPListItem
object:$item["Title"] = "PowerShell" $item["Name"] = "PowerShell" $item["Master Page URL"] = "/_catalogs/masterpages/seattle.master" $item["Theme URL"] = "/_catalogs/theme/15/palette005.spcolor" $item["Image URL"] = "/_layouts/15/images/image_bg005.jpg" $item["Font Scheme URL"] = "/_catalogs/theme/15/fontscheme003.spfont" $item["Display Order"] = "200"
Update
method on SPList
to update the Items
collection:$item.Update()
Dispose
method to discard the SPWeb
object:$web.Dispose()
Follow these steps to create a custom composed look with code using the server-side object model:
using
statement:using (var site = new SPSite("http://sharepoint/site"))
using
statement:using (var web = site.OpenWeb())
SPList
object representing the _catalogs/design
list from the SPWeb
object:var list = web.Lists["Composed Looks"];
SPListItem
to the Items
collection of the SPList
object:var item = list.Items.Add();
SPListItem
object:item["Title"] = "PowerShell"; item["Name"] = "PowerShell"; item["Master Page URL"] = "/_catalogs/masterpages/seattle.master"; item["Theme URL"] = "/_catalogs/theme/15/palette005.spcolor"; item["Image URL"] = "/_layouts/15/images/image_bg005.jpg";
item["Font Scheme URL"] = "/_catalogs/theme/15/fontscheme003.spfont"; item["Display Order"] = "200";
Update
method on the SPList
object to update the Items
collection:item.Update();
18.220.187.223