This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof Sys != "undefined" && Sys && Sys.Application) { | |
Sys.Application.notifyScriptLoaded(); | |
} | |
if (typeof SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs =="function") { | |
SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs("NameOfMyScriptGoesHere.min.js"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SP.SOD.executeOrDelayUntilScriptLoaded(function () { | |
//your code goes here | |
}, "NameOfMyScriptGoesHere.min.js"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.SubscriptionEvent('myDisplayTemplateLoadingCheck').publish("DisplayTemplateName"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _totalLoadedTemplates = 0; | |
var _requiredAmountOfTemplates = 3; //Let's say you need 3 templates to load before you run your code | |
$.SubscriptionEvent('myDisplayTemplateLoadingCheck').subscribe ( function (data ) { | |
totalLoadedTemplates += 1; | |
if (_totalLoadedTemplates === _requiredAmountOfTemplates) { | |
//your code goes here | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> | |
<CustomAction Id="AwesomeSiteJS" Location="ScriptLink" ScriptBlock="document.write('<script src="~sitecollection/Style Library/Awesome.min.js"></' + 'script>');"Sequence="10" /> | |
</Elements> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> | |
<CustomAction Id="AwesomeSiteJS" Location="ScriptLink" ScriptBlock="if (document.getElementsByTagName('Body')[0].className.trim().toLowerCase().indexOf('custommaster') > -1) { document.write('<script src="~sitecollection/Style Library/AwesomeSite.min.js"></' + 'script>');}" Sequence="10" /> | |
</Elements> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Set-AvailableAndDefaultPageLayouts | |
{ | |
param ( | |
[Microsoft.SharePoint.Client.ClientContext]$clientContext, | |
[Microsoft.SharePoint.Client.Web]$web, | |
[array]$pageLayoutUrls, | |
[string]$defaultPageLayoutUrl | |
) | |
process | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pageLayoutUrls = @("/_catalogs/masterpage/ArticleContentPage.aspx","/_catalogs/masterpage/RedirectPageLayout.aspx") | |
$defaultPageLayoutUrl ="/_catalogs/masterpage/ArticleContentPage.aspx" | |
Set-AvailableAndDefaultPageLayouts -clientContext $clientContext -web $web -pageLayoutUrls $pageLayoutUrls -defaultPageLayoutUrl$defaultPageLayoutUrl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Set-WelcomePage | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[Parameter(Mandatory=$true, Position=1)] | |
$clientContext, | |
[Parameter(Mandatory=$true, Position=2)] | |
$web, | |
[Parameter(Mandatory=$true, Position=3)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-WelcomePage -clientContext $clientContext -web $web -welcomePageUrl 'Pages/AmazingWikiPageWithPicturesAndLinksAndFreeStuff.aspx' |