Skip to content

Instantly share code, notes, and snippets.

Chris Kent thechriskent

Block or report user

Report or block thechriskent

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thechriskent
thechriskent / SharePoint Embed Domains.ps1
Created Nov 11, 2019
Demonstrates adding a domain to the list of allowed domains across multiple SharePoint sites (useful for the Embed webpart)
View SharePoint Embed Domains.ps1
$SiteUrls = @("HR","Accounting","IT")
foreach($SiteUrl in $SiteUrls) {
Write-Host -ForegroundColor Cyan "Applying to $SiteUrl..."
$FullSiteUrl = "https://superspecial.sharepoint.com/sites/$SiteUrl"
Connect-PnPOnline $FullSiteUrl -ErrorAction Stop
View Author Fix for page modernization
#Script to fix the user mapping issues from page modernization
$SiteUrls = @(
"SGA"
)
$shouldFix = $true
try {
$checkedoutPages = @()
foreach($SiteUrl in $SiteUrls) {
View LogItemUsage.js
function logItemUsage(itemId, listName) {
SP.SOD.executeOrDelayUntilScriptLoaded(function() {
var stuff = {
ctx: SP.ClientContext.get_current()
};
stuff.user = stuff.ctx.get_web().get_currentUser();
stuff.ctx.load(stuff.user);
stuff.scope = "{00000000-0000-0000-0000-000000000000}";
stuff.site = stuff.ctx.get_site();
stuff.ctx.load(stuff.site);
View iconFormat.json
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"elmType": "div",
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "Balloons"
},
"style": {
View svgIconFormat.json
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"elmType": "div",
"children": [
{
"elmType": "svg",
"style": {
"padding-right": "6px",
"width": "13px",
"height": "13px",
@thechriskent
thechriskent / ColorColumns.json
Last active Dec 11, 2017
Quick sample of applying customized colors
View ColorColumns.json
{
"$schema": "https://gist.githubusercontent.com/thechriskent/2e09be14a4b491cfae256220cfca6310/raw/eb9f675bf523208eb840c462d4f716fa92ce14c2/columnFormattingSchema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": {
"operator": "?",
"operands": [
{
"operator": "==",
@thechriskent
thechriskent / columnFormattingSchema.json
Last active Sep 24, 2019
A Verbose Schema for SharePoint Column Formatting (Proposed)
View columnFormattingSchema.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "CustomtFormatter JSON",
"description": "CustomFormatter renderer for SharePoint lists",
"definitions": {
"customAction": {
"type": "object",
"additionalProperties": false,
"title": "Action object",
"description": "Action object for a custom action button",
You can’t perform that action at this time.