SharePoint Online 365 _spPageContextInfo

In SharePoint Online 365, the _spPageContextInfo has more properties compared to SharePoint 2013. To view the SharePoint 2013 _spPageContextInfo, please go to blog SharePoint 2013 Javascript _spPageContextInfo.

When coding in SharePoint using JavaScript, then _spPageContextInfo code comes really in handy. _spPageContextInfo is a code that contains information about the current context or details about the SharePoint site. Some of the main data able to retrieve from _spPageContextInfo include:

Property SP 2010 SP 2013 SP Online 365 Example Value
webServerRelativeUrl x x x /Test Site
webAbsoluteUrl x x /Test Site
viewId x GUID
listId x x x GUID
listPermsMask x Object with properties
High & Low
listUrl x /Test Site/Pages
listTitle x Pages
listBaseTemplate x 850
viewOnlyExperience
Enabled
x false
blockDownloads
ExperienceEnabled
x false
cdnPrefix x static.sharepointonline
.com/bld
siteAbsoluteUrl x x https://test.sharepoint.com
siteId x https://test.sharepoint.com
showNGSCDialog
ForSyncOnTS
x false
supportPoundStorePath x false
supportPoundStorePath x false
siteSubscriptionId x Guid
isSPO x true
farmLabel x AUS_3_Content
serverRequestPath x x /Site/Pages/MyForm.aspx
layoutsUrl x x _layouts/15
webId x Guid
webTitle x x TestSite
webTemplate x x 1
tenantAppVersion x x 0
isAppWeb x false
webLogoUrl x x _layouts/15/images/
siteicon.png
webLanguage x x x 1033
currentLanguage x x x 1033
currentUICultureName x x en-US
currentCultureName x x en-US
env (environment) x prod
nid x 443
fid x 17518
serverTime x 2017-03-22T00:
11:23.6006021Z
serverTime x x 12$$16.0.6316.1203
crossDomainPhotos
Enabled
x x true
openInClient x false
webUIVersion x x x 15
webPermMasks x x Object with properties
High & Low
pageListId x x x Guid
pageItemId x x x 1
pagePermsMask x Object with properties
High & Low
pagePersonalization
Scope
x x 1
userEmail x
userId x x x 10
userLoginName x admin@test.onmicrosoft.com
userDisplayName x (fullName)
isAnonymousGuestUser x false
isExternalGuestUser x false
systemUserKey x x i:0h.f|(sid)
alertsEnabled x x x true
siteServerRelativeUrl x x /
allowSilverlightPrompt x x x True
themeCacheToken x /TestSite::1:16.0.6316.1203
themedCssFolderUrl x null
themedImageFileNames x null
isSiteAdmin x true
ExpFeatures x (Array of Numbers)
eg. :[-1935701612,2018769739,
1964068928]
killSwitches x (look below)
(Many Guid with boolean value)
eg. {“6800C0DF-81BF-4446-9D60-2749595D1028”:true,
“417833A3-7AFB-4E80-92AF-193E0D64FE6F”:true}
CorrelationId x Guid
hasManageWeb
Permissions
x true
isNoScriptEnabled x true
groupId x null
groupHasHomepage x false
isWebWelcomePage x false
siteClassification x
hideSyncButtonOnODB x false
showNGSCDialog
ForSyncOnODB
x false
sitePagesEnabled x true
DesignPackageId x Guid eg. 00000000-0000-0000-0000-000000000000
groupType x null
groupColor x #da3b01
siteColor x #da3b01
navigationInfo x null
MenuData x (look below)
Array of menu items.
eg. {“SettingsData”:[
{“Id”:”SuiteMenu_zz8_MenuItemAddPage”,
“Text”:”Add a page”,
“Url”:”/TestSite/_layouts/15/CreateSitePage.aspx”},{“Id”:”SuiteMenu_zz5_MenuItemCreate”,
“Text”:”Add an app”,
“Url”:”/TestSite Site/_layouts/15/addanapp.aspx”}]}
RecycleBinItemCount x -1
PublishingFeatureOn x false
PreviewFeaturesEnabled x false
disableAppViews x false
disableFlows x false
serverRedirectedUrl x null
formDigestValue x (long string of numbers, date time)
maximumFileSize x 10240
formDigestTimeoutSeconds x 1800
canUserCreateMicrosoftForm x false
readOnlyState x null

Leave a Reply

Your email address will not be published. Required fields are marked *