Skip to content

Commit cdf75d3

Browse files
committed
Merge branch 'master' of https://github.com/Lauragra/sp-dev-docs
2 parents b478429 + b21c58a commit cdf75d3

File tree

6 files changed

+45
-48
lines changed

6 files changed

+45
-48
lines changed

docs/declarative-customization/site-theming/sharepoint-site-theming-csom.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
# SharePoint site theming: CSOM development
22

3-
The SharePoint Client Side Object Model (CSOM) provides .NET developers with access to the SharePoint object model from code that is running locally or on a different server than SharePoint. This topic covers the site theming functionality available in CSOM.
3+
The SharePoint client-side object model (CSOM) provides access to the SharePoint object model from code that is running locally or on a different server than SharePoint.
44

55
## Prerequisites
6-
This topic assumes you are familiar with the topics [Using the Client Object Model](https://msdn.microsoft.com/en-us/library/ff798388.aspx) and [Common Programming Tasks in the Managed Client Object Model](https://msdn.microsoft.com/en-us/library/ee537013.aspx), which cover how to work with the SharePoint CSOM.
6+
Before you get started, make sure that you're familiar with the following:
7+
- [Using the Client Object Model](https://msdn.microsoft.com/en-us/library/ff798388.aspx)
8+
- [Common Programming Tasks in the Managed Client Object Model](https://msdn.microsoft.com/en-us/library/ee537013.aspx)
79

810
Install the following components for CSOM development:
911

1012
* [SharePoint Server 2016 Client Component SDK](https://www.microsoft.com/en-us/download/details.aspx?id=51679)
1113
* [Microsoft.SharePointOnline.CSOM](https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM/) NuGet package (version 16.1.6906.1200 or later)
1214

13-
## Sample code
15+
## CSOM code example
1416

15-
The following sample shows how to create a __Microsoft.Online.SharePoint.TenantAdministration.Tenant__ object and call the __GetAllTenantThemes__ method to return a list of themes. Notes on this sample:
17+
The following example shows how to create a __Microsoft.Online.SharePoint.TenantAdministration.Tenant__ object and call the __GetAllTenantThemes__ method to return a list of themes.
1618

17-
* The URL used for creating the context object includes the _-admin_ suffix, because TenantAdministration methods work with the admin site.
18-
* Create a __Tenant__ instance with the [Tenant constructor](https://msdn.microsoft.com/en-us/library/dn174852.aspx), and then call the methods on that instance.
19-
* The same approach can be used for calling other theme management methods.
19+
>**Note:**
20+
>* The URL used to create the context object includes the _-admin_ suffix, because **TenantAdministration** methods work with the admin site.
21+
>* Create a __Tenant__ instance with the [Tenant constructor](https://msdn.microsoft.com/en-us/library/dn174852.aspx), and then call the methods on that instance.
22+
>* You can use the same approach to call other theme management methods.
2023
2124
```C#
2225
using System.Security;
@@ -33,7 +36,7 @@ Tenant tenant = new Tenant(ctx);
3336
SPClient.ClientObjectList<ThemeProperties> themes = tenant.GetAllTenantThemes();
3437
```
3538

36-
## Sample theme definition
39+
## Theme definition example
3740

3841
For methods that take a theme argument, the following code defines an __SPOTheme__ class that you can use to create custom themes.
3942

@@ -69,11 +72,11 @@ public class SPOTheme 
6972

7073
## Applying a theme
7174

72-
The methods covered below are used to manage the available themes in your tenant. To _apply_ a theme to a particular SharePoint web site, use the [SPWeb.ApplyTheme](https://msdn.microsoft.com/en-us/library/office/jj251358.aspx) method of the [Microsoft.SharePoint.Client.Web](https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.web.aspx) class.
75+
The methods described in this section are used to manage the available themes in your tenant. To _apply_ a theme to a particular SharePoint website, use the [SPWeb.ApplyTheme](https://msdn.microsoft.com/en-us/library/office/jj251358.aspx) method of the [Microsoft.SharePoint.Client.Web](https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.web.aspx) class.
7376

7477
## Methods/properties of the Microsoft.Online.SharePoint.TenantAdministration.Tenant class
7578

76-
These methods can be used to customize a SharePoint tenant administration site's set of available themes. You can add a new custom theme, update an existing theme, or delete a theme, and you can retrieve a specific theme or all themes. You can also hide or restore the default themes that come with SharePoint.
79+
Use the following methods to customize the set of available themes for a SharePoint tenant administration site. You can add a new custom theme, update an existing theme, or delete a theme, and you can retrieve a specific theme or all themes. You can also hide or restore the default themes that come with SharePoint.
7780

7881
### AddTenantTheme public method
7982
Add a theme to the tenant.
@@ -90,7 +93,7 @@ __Parameters:__ string name<br/>
9093
__Return type:__ void
9194

9295
### GetAllTenantThemes public method
93-
Retrieve all of the themes currently available in the tenant, including any custom themes that have been added. Default themes are only included if the __HideDefaultThemes__ property is __false__ (the default value).
96+
Retrieve all the themes that are currently available in the tenant, including any custom themes that have been added. Default themes are only included if the __HideDefaultThemes__ property is __false__ (the default value).
9497

9598
__Namespace:__ Microsoft.Online.SharePoint.TenantAdministration.Tenant<br/>
9699
__Parameters:__ none<br/>
@@ -104,7 +107,7 @@ __Parameters:__ string name<br/>
104107
__Return type:__ ThemeProperties
105108

106109
### HideDefaultThemes public property
107-
This property indicates whether the default themes ("out of the box" themes) are hidden in the theme picker user interface for modern pages. You might want to set this property to __true__ after defining custom themes, to allow only specific themes to be used.
110+
This property indicates whether the default themes are hidden in the theme picker UI for modern pages. You might want to set this property to __true__ after you define custom themes, to allow only specific themes to be used.
108111

109112
__Namespace:__ Microsoft.Online.SharePoint.TenantAdministration.Tenant<br/>
110113
__Type:__ Boolean
@@ -118,7 +121,7 @@ __Return type:__ ClientResult<bool>
118121

119122
## Methods of the Microsoft.Online.SharePoint.TenantManagement.Tenant class
120123

121-
These methods can be used to manage themes in a multi-tenant environment.
124+
Use the following methods to manage themes in a multitenant environment.
122125

123126
### AddTenantTheme public method
124127
Add a theme to the tenant.
@@ -128,14 +131,14 @@ __Parameters:__ string name, string themeJson<br/>
128131
__Return type:__ ClientResult<bool>
129132

130133
### GetAllTenantThemes public method
131-
Retrieve all of the themes currently available in the tenant, including any custom themes that have been added. Default themes are only included if the __HideDefaultThemes__ property is __false__ (the default value).
134+
Retrieve all the themes that are currently available in the tenant, including any custom themes that have been added. Default themes are only included if the __HideDefaultThemes__ property is __false__ (the default value).
132135

133136
__Namespace:__ Microsoft.Online.SharePoint.TenantManagement.Tenant<br/>
134137
__Parameters:__ none<br/>
135138
__Return type:__ ClientObjectList<ThemeProperties>
136139

137140
### GetHideDefaultThemes public method
138-
Read the current setting for whether to hide default themes in the theme picker user interface.
141+
Read the current setting for whether to hide default themes in the theme picker UI.
139142

140143
__Namespace:__ Microsoft.Online.SharePoint.TenantManagement.Tenant<br/>
141144
__Parameters:__ none<br/>
@@ -149,7 +152,7 @@ __Parameters:__ string name<br/>
149152
__Return type:__ ThemeProperties
150153

151154
### SetHideDefaultThemes public method
152-
Specify whether to hide default themes in the theme picker user interface.
155+
Specify whether to hide default themes in the theme picker UI.
153156

154157
__Namespace:__ Microsoft.Online.SharePoint.TenantManagement.Tenant<br/>
155158
__Parameters:__ Boolean<br/>
@@ -166,7 +169,7 @@ __Return type:__ ClientResult<bool>
166169

167170
* [SharePoint site theming overview](sharepoint-site-theming-overview.md)
168171
* [SharePoint site theming: JSON schema](sharepoint-site-theming-json-schema.md)
169-
* [SharePoint site theming: PowerShell commands](sharepoint-site-theming-powershell.md)
172+
* [SharePoint site theming: PowerShell cmdlets](sharepoint-site-theming-powershell.md)
170173
* [SharePoint site theming: REST API](sharepoint-site-theming-rest-api.md)
171174
* [Using the Client Object Model](https://msdn.microsoft.com/en-us/library/ff798388.aspx)
172175
* [Common Programming Tasks in the Managed Client Object Model](https://msdn.microsoft.com/en-us/library/ee537013.aspx)

docs/declarative-customization/site-theming/sharepoint-site-theming-json-schema.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The new [SharePoint site theming](sharepoint-site-theming-overview.md) features use a JSON schema to store color settings and other information about each theme. Theme settings are stored in a JSON object that contains the following keys:
44

5-
* __name__ &mdash; The name of the theme, which appears in the theme picker UI and is also used by administrators and developers to refer to the theme in PowerShell commands or calls to the SharePoint REST API.
5+
* __name__ &mdash; The name of the theme, which appears in the theme picker UI and is also used by administrators and developers to refer to the theme in PowerShell cmdlets or calls to the SharePoint REST API.
66
* __isInverted__ &mdash; This value should be false for light themes and true for dark themes; it controls whether SharePoint will use dark or light theme colors to render text on colored backgrounds.
77
* __backgroundImageUril__ &mdash; The URI of an optional background image for the theme (value can be blank if no background image).
88
* __theme__ &mdash; The RGB color settings for the theme, stored as a nested JSON object with the following keys:
@@ -376,6 +376,6 @@ The following code shows how to define a dictionary in PowerShell for the Dark B
376376
## See also
377377

378378
* [SharePoint site theming overview](sharepoint-site-theming-overview.md)
379-
* [SharePoint site theming: PowerShell commands](sharepoint-site-theming-powershell.md)
379+
* [SharePoint site theming: PowerShell cmdlets](sharepoint-site-theming-powershell.md)
380380
* [SharePoint site theming: CSOM](sharepoint-site-theming-csom.md)
381381
* [SharePoint site theming: REST API](sharepoint-site-theming-rest-api.md)

docs/declarative-customization/site-theming/sharepoint-site-theming-overview.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ SharePoint site owners have new options for applying custom styles and colors to
66
* A simplified set of default themes, with six light themes and two dark themes presently available.
77
* Control over which themes are available for use on pages within your sites. For example, you can define custom themes based on your organization's branding or identity, and make those the only available themes within your sites.
88

9-
<!-- Global: We should refer to PowerShell "cmdlets" instead of "commands", to be consistent with the admin docs on TechNet. -->
10-
11-
These capabilities are available to administrators via [PowerShell commands](sharepoint-site-theming-powershell.md), and to developers via the SharePoint [Client Side Object Model (CSOM)](sharepoint-site-theming-csom.md) or the SharePoint [REST API](sharepoint-site-theming-rest-api.md).
9+
These capabilities are available to administrators via [PowerShell cmdlets](sharepoint-site-theming-powershell.md), and to developers via the SharePoint [Client Side Object Model (CSOM)](sharepoint-site-theming-csom.md) or the SharePoint [REST API](sharepoint-site-theming-rest-api.md).
1210

1311
For general information about working with themes to customize the look of your sites, see [Change the look of your SharePoint site](https://support.office.com/en-us/article/Change-the-look-of-your-SharePoint-site-06bbadc3-6b04-4a60-9d14-894f6a170818).
1412

@@ -54,6 +52,6 @@ For the simplest experience, we recommend that you use modern themes with modern
5452
## See also
5553

5654
* [SharePoint site theming: JSON schema](sharepoint-site-theming-json-schema.md)
57-
* [SharePoint site theming: PowerShell commands](sharepoint-site-theming-powershell.md)
55+
* [SharePoint site theming: PowerShell cmdlets](sharepoint-site-theming-powershell.md)
5856
* [SharePoint site theming: CSOM](sharepoint-site-theming-csom.md)
5957
* [SharePoint site theming: REST API](sharepoint-site-theming-rest-api.md)

docs/declarative-customization/site-theming/sharepoint-site-theming-powershell.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
# SharePoint site theming: PowerShell commands
1+
# SharePoint site theming: PowerShell cmdlets
22

3-
<!-- Global: We should refer to PowerShell "cmdlets" instead of "commands", to be consistent with the admin docs on TechNet. -->
4-
5-
SharePoint tenant administrators can use PowerShell commands to create, retrieve, and remove site themes. Developers can also use the SharePoint [REST API](sharepoint-site-theming-rest-api.md) to handle theme management tasks.
3+
SharePoint tenant administrators can use PowerShell cmdlets to create, retrieve, and remove site themes. Developers can also use the SharePoint [REST API](sharepoint-site-theming-rest-api.md) to handle theme management tasks.
64

75
For information about how themes are defined and stored, see [JSON schema reference](sharepoint-site-theming-json-schema.md).
86

97
## Getting started
108

11-
To run the PowerShell commands for theme management, you'll need to download and install the SharePoint Online Management Shell, and then connect to your SharePoint tenant from within the shell:
9+
To run the PowerShell cmdlets for theme management, you'll need to do the following:
1210

1311
1. Download and install the [SharePoint Online Management Shell](https://www.microsoft.com/en-us/download/details.aspx?id=35588). If you already have a previous version of the shell installed, uninstall it first and then install the latest version.
14-
2. After the shell is installed, follow the instructions at [Connect to SharePoint Online PowerShell](https://technet.microsoft.com/en-us/library/fp161372.aspx) to connect to your SharePoint tenant.
12+
2. Follow the instructions at [Connect to SharePoint Online PowerShell](https://technet.microsoft.com/en-us/library/fp161372.aspx) to connect to your SharePoint tenant.
1513

16-
To verify your setup, try using the **Get-HideDefaultThemes** command to read the HideDefaultThemes setting. If the command runs and returns False with no errors, as shown in the following example, you're ready to proceed.
14+
To verify your setup, try using the **Get-HideDefaultThemes** cmdlet to read the HideDefaultThemes setting. If the cmdlet runs and returns False with no errors, as shown in the following example, you're ready to proceed.
1715

1816
```powershell
1917
c:\> Get-HideDefaultThemes
2018
False
2119
```
22-
## Site theme commands
20+
## Site theme cmdlets
2321

24-
The following commands are available for managing site themes from PowerShell:
22+
The following cmdlets are available for managing site themes from PowerShell:
2523

2624
* **Add-SPOTheme** &mdash; Creates a new custom theme, or overwrites an existing theme to modify its settings.
2725
* **Get-SPOTheme** &mdash; Retrieves settings for an existing theme.
@@ -31,7 +29,7 @@ The following commands are available for managing site themes from PowerShell:
3129

3230
## Add-SPOTheme
3331

34-
The **Add-SPOTheme** command creates a new theme or updates an existing theme. The color pallette settings are passed as a dictionary.
32+
The **Add-SPOTheme** cmdlet creates a new theme or updates an existing theme. The color pallette settings are passed as a dictionary.
3533

3634
In the following example, a new theme named "Custom Cyan" is created, with color pallette settings that are various shades of cyan. Note that this example uses a ```HashToDictionary``` function to convert a hash table created with the ```@{}``` notation into a dictionary, as required by **Add-SPOTheme**.
3735

@@ -77,7 +75,7 @@ $themepallette = HashToDictionary(
7775
7876
Add-SPOTheme -Name "Custom Cyan" -Palette $themepallette -IsInverted $false
7977
```
80-
If you want to update an existing theme (to modify some of its color settings, for example), use the same syntax as shown previously but add the *-Overwrite* flag to the **Add-SPOTheme** command.
78+
If you want to update an existing theme (to modify some of its color settings, for example), use the same syntax as shown previously but add the *-Overwrite* flag to the **Add-SPOTheme** cmdlet.
8179

8280
```powershell
8381
Add-SPOTheme -Name "Custom Cyan" -Palette $themepallette -IsInverted $false -Overwrite
@@ -86,7 +84,7 @@ Adding a theme does not apply the theme to any sites. It adds the theme to your
8684

8785
## Get-SPOTheme
8886

89-
The **Get-SPOTheme** command returns the settings for an existing theme. For example, here's how to use the **Get-SPOTheme** command to return the settings for the "Custom Cyan" theme created in the previous example.
87+
The **Get-SPOTheme** cmdlet returns the settings for an existing theme. For example, here's how to use the **Get-SPOTheme** cmdlet to return the settings for the "Custom Cyan" theme created in the previous example.
9088

9189
```powershell
9290
C:\> Get-SPOTheme -Name "Custom Cyan" | ConvertTo-Json
@@ -142,19 +140,18 @@ Custom Cyan
142140
```
143141
## Remove-SPOTheme
144142

145-
The **Remove-SPOTheme** command removes a theme from your tenant store. For example, this command removes the "Custom Cyan" theme that was used in the previous examples.
143+
The **Remove-SPOTheme** cmdlet removes a theme from your tenant store. For example, this cmdlet removes the "Custom Cyan" theme that was used in the previous examples.
146144

147145
```powershell
148146
c:\> Remove-SPOTheme -Name "Custom Cyan"
149147
```
150148
## Set-HideDefaultThemes
151149

152-
>[!NOTE]
153-
>This command will be renamed to ```Set-SPOHideDefaultThemes``` in a future release, for consistency with other SharePoint PowerShell commands.
150+
_NOTE: this cmdlet will be renamed to ```Set-SPOHideDefaultThemes``` in a future release, for consistency with other SharePoint PowerShell cmdlet._
154151

155-
The **Set-HideDefaultThemes** command is used to specify whether the default themes that come with SharePoint should be included in the theme picker list. For example, you might want to create custom themes for your sites and then remove the default themes, to ensure that all pages will use your custom themes.
152+
The **Set-HideDefaultThemes** cmdlet is used to specify whether the default themes that come with SharePoint should be included in the theme picker list. For example, you might want to create custom themes for your sites and then remove the default themes, to ensure that all pages will use your custom themes.
156153

157-
Specify the setting as either _$true_ to hide the default themes, or _$false_ (the default setting) to allow use of the default themes. For example, this command hides the default themes.
154+
Specify the setting as either _$true_ to hide the default themes, or _$false_ (the default setting) to allow use of the default themes. For example, this cmdlet hides the default themes.
158155

159156
```powershell
160157
Set-HideDefaultThemes $true
@@ -163,17 +160,16 @@ After creating the "Custom Cyan" theme, hiding the default themes will leave onl
163160

164161
![Change the look box with default themes hidden and the custom Cyan theme shown](../../images/theme-hidedefaults.png)
165162

166-
To restore the default themes to the theme picker list, use the following command.
163+
To restore the default themes to the theme picker list, use the following cmdlet.
167164
```powershell
168165
Set-HideDefaultThemes $false
169166
```
170167

171168
## Get-HideDefaultThemes
172169

173-
>[!NOTE]
174-
>This command will be renamed to ```Get-SPOHideDefaultThemes``` in a future release, for consistency with other SharePoint PowerShell commands.
170+
_NOTE: this cmdlet will be renamed to ```Get-SPOHideDefaultThemes``` in a future release, for consistency with other SharePoint PowerShell cmdlets._
175171

176-
The **Get-HideDefaultThemes** command retrieves the currrent **Set-HideDefaultThemes** setting. You might want to use this command in a PowerShell script to read the setting and then take different actions based on whether the default themes are hidden. This command does not have any parameters.
172+
The **Get-HideDefaultThemes** cmdlet retrieves the currrent **Set-HideDefaultThemes** setting. You might want to use this cmdlet in a PowerShell script to read the setting and then take different actions based on whether the default themes are hidden. This cmdlet does not have any parameters.
177173

178174
```powershell
179175
c:\> Get-HideDefaultThemes

0 commit comments

Comments
 (0)