Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
#ValoRun #ValoLove

Piotr Siatka siata13

💭
#ValoRun #ValoLove
View GitHub Profile
@siata13
siata13 / RegisterTemplatesSourceFolder.ps1
Created May 6, 2020
Register templates source folder for custom page templates
View RegisterTemplatesSourceFolder.ps1
$templatesFolder = Resolve-PnPFolder -SiteRelativePath "SitePages/Templates"
Set-PnPPropertyBagValue -Folder "SitePages" -Key "vti_TemplatesFolderGuid" -Value $templatesFolder.UniqueId
@siata13
siata13 / OrgAssetsService.types.ts
Created Sep 10, 2019
Types used by Organisation Assets Service
View OrgAssetsService.types.ts
export interface ResourcePath {
DecodedUrl: string;
}
export enum CdnType {
Public = 0,
Private = 1
}
export enum OrgAssetType {
@siata13
siata13 / OrgAssetsService.ts
Created Sep 10, 2019
Organisation Assets Service
View OrgAssetsService.ts
import { WebPartContext } from "@microsoft/sp-webpart-base";
import { SPHttpClient } from "@microsoft/sp-http";
import { OrgAssetsData, CdnType, OrgAssetType, AddOrgAssetCdnRequest, ResourcePath } from "./OrgAssetsService.types";
import { Guid } from "@microsoft/sp-core-library";
export class OrgAssetsService {
private context: WebPartContext;
constructor(context: WebPartContext) {
this.context = context;
View ProvisionTaxPrerequisites.ps1
$list = Get-PnPList -Identity "TaxonomyHiddenList";
$web = Get-PnPWeb;
$params = @{ "TaxonomyHiddenListId" = $list.Id; "WebId" = $web.Id }
Apply-PnPProvisioningTemplate -Path $templatePath -Parameters $params
@siata13
siata13 / EnableTaxonomyFeature.ps1
Created May 16, 2019
Enable taxonomy site feature
View EnableTaxonomyFeature.ps1
Enable-PnPFeature -Identity “73ef14b1-13a9-416b-a9b5-ececa2b0604c” -Scope Site
@siata13
siata13 / TaxonomyPrerequisite.xml
Last active Jun 24, 2019
TaxonomyPrerequisite.xml
View TaxonomyPrerequisite.xml
<?xml version="1.0"?>
<pnp:Provisioning
xmlns:pnp="http://schemas.dev.office.com/PnP/2018/01/ProvisioningSchema">
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=2.20.1711.0, Culture=neutral, PublicKeyToken=3751622786b357c2" />
<pnp:Templates ID="TaxonomyPrerequisite-TEMPLATES">
<pnp:ProvisioningTemplate ID="ValoPrerequisite-v-1.0" Version="1" Scope="RootSite">
<pnp:SiteFields>
<Field Type="LookupMulti" DisplayName="Taxonomy Catch All Column" StaticName="TaxCatchAll" Name="TaxCatchAll" ID="{f3b0adf9-c1a2-4b02-920d-943fba4b3611}" ShowInViewForms="FALSE" List="{parameter:TaxonomyHiddenListId}" WebId="{parameter:WebId}" Required="FALSE" CanToggleHidden="TRUE" ShowField="CatchAllData" SourceID="{484c8c59-755d-4516-b8d2-1621b38262b4}" Mult="TRUE" Sortable="FALSE" AllowDeletion="TRUE" Sealed="TRUE" Hidden="TRUE" />
<Field Type="LookupMulti" DisplayName="Taxonomy Catch All Column1" StaticName="TaxCatchAllLabel" Name="TaxCatchAllLabel" ID="{8f6b6dd8-9357-4019-8172-966fcd502ed2}"
View PnP_MultipleColumns.SP2019.aspx
<%@ Page language="C#" Inherits="Microsoft.SharePoint.WebControls.ClientSidePage, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head>
<!--[if gte mso 9]><SharePoint:CTFieldRefs runat=server Prefix="mso:" FieldList="PnPTextField,PnPChoiceField,FileLeafRef,ClientSideApplicationId,PageLayoutType,CanvasContent1,BannerImageUrl,BannerImageOffset,PromotedState,FirstPublishedDate,LayoutWebpartsContent,mb5ae19ff37c4effb60b89ff70e494c2,TaxCatchAllLabel"><xml>
<mso:CustomDocumentProperties>
<mso:PageLayoutType msdt:dt="string">Article</mso:PageLayoutType>
<mso:CanvasContent1 msdt:dt="string">&lt;div&gt;&lt;div data-sp-canvascontrol=&quot;&quot; data-sp-canvasdataversion=&quot;1.0&qu
@siata13
siata13 / PnP_MultipleColumns.xml
Last active Apr 22, 2019
PnP_MultipleColumns
View PnP_MultipleColumns.xml
<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2018/05/ProvisioningSchema">
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=2.26.1805.1, Culture=neutral, PublicKeyToken=5e633289e95c321a" />
<pnp:Templates ID="CONTAINER-DEFAULTPAGETEMPLATES">
<pnp:ProvisioningTemplate ID="DEFAULTPAGETEMPLATES" Version="0" Scope="RootSite">
<pnp:ClientSidePages>
<pnp:ClientSidePage Title="{parameter:PageTitle}" PageName="{parameter:PageName}" PromoteAsNewsArticle="false" Overwrite="true" EnableComments="false">
<pnp:Sections>
<pnp:Section Order="1" Type="TwoColumnLeft">
<pnp:Controls>
View SPThemeService.ts
import { SPHttpClient, SPHttpClientResponse } from "@microsoft/sp-http";
import { IPartialTheme } from "@uifabric/styling/lib";
export interface IThemingOptions {
'@odata.context': string;
hideDefaultThemes: boolean;
themePreviews: IThemePreview[];
}
export interface IThemePreview {
View Get-Colors.ps1
function Get-Colors {
param (
[string]$colorsDataString
)
$colorsJSONData = $colorsDataString | ConvertFrom-Json;
[Colors]$colors = [Colors]::new();
$colors.psobject.properties | ForEach-Object {
if ($colorsJSONData.($_.Name)) {
$colors.($_.Name) = $colorsJSONData.($_.Name)
You can’t perform that action at this time.