- Introduced custom branding CSS styles in `custom-branding.css`. - Created example JSON configuration for custom branding in `custom-branding.example.json`. - Implemented branding configuration logic in `BrandingConfig.ts` to normalize and validate branding settings. - Developed CSS loader to manage loading and unloading of custom stylesheets in `BrandingCssLoader.ts`. - Added DOM rendering capabilities for branding elements in `BrandingDomRenderer.ts`. - Defined types and interfaces for branding elements and configurations in `BrandingTypes.ts`. - Included localization support for German in `de-de.js`. - Added unit tests for branding configuration, CSS loader, and DOM renderer. - Validated project structure and static assets with new validation scripts.
31 lines
1.1 KiB
Markdown
31 lines
1.1 KiB
Markdown
# CustomBranding für klassische SharePoint-Seiten
|
|
|
|
Die Classic-Runtime liest dieselbe zentrale `SPSite.UserCustomAction` wie der moderne Application Customizer. Sie rendert das abgesicherte Konfigurationsschema ohne SPFx-Abhängigkeit und lädt die freigegebenen Stylesheets.
|
|
|
|
## Bereitstellung
|
|
|
|
1. `npm run build:classic` ausführen.
|
|
2. `classic/dist/custom-branding-classic.js` beispielsweise nach `/SiteAssets/custom-branding/` hochladen.
|
|
3. Den site-scoped ScriptLink zusammen mit der zentralen Application-Customizer-Action registrieren:
|
|
|
|
```powershell
|
|
.\deployment\add-custombranding.ps1 `
|
|
-SiteUrl 'http://clshp001/sites/portal' `
|
|
-ClassicScriptUrl '~sitecollection/SiteAssets/custom-branding/custom-branding-classic.js'
|
|
```
|
|
|
|
Der ScriptLink gilt für Root Web, vorhandene Subwebs und später angelegte Subwebs der Site Collection. Zum Entfernen:
|
|
|
|
```powershell
|
|
.\deployment\add-custombranding.ps1 `
|
|
-SiteUrl 'http://clshp001/sites/portal' `
|
|
-RemoveClassicScriptLink
|
|
```
|
|
|
|
## Diagnose
|
|
|
|
```javascript
|
|
typeof window.CustomBrandingClassic
|
|
window.CustomBrandingClassic.reload()
|
|
```
|