skip to Main Content

SharePoint Display plugin shortcode

[o365_sp_view siteID="dwsnow.sharepoint.com,87fb8dbb-4dd8-42e6-8ab9-8bf82b1319f5,4d9359e7-3ffc-4e62-8743-be09b42b9059" driveID="b!u437h9hN5kKKuYv4KxMZ9edZk038P2JOh0O-CbQrkFkANXjgXs5yR50Rectsg_K9" itemid="folder_id" template="listv1_tpl.php" id="temp2" maxresults="5" pagination="yes"  sort="title" columns="lastModifiedDateTime,size,displayName,webUrl,name,createdBy,folder,file,id" userbinding="no"]

Shortcode perameters:

siteID: Id of the site
driveId : Id of the drive
itemid : Id of the folder
Template : Template name
id : Uniqure identifire for result div
maxresults : How many items will show in result and it should be integer number
pagination : Would result show with pagination or without pagination, option can be yes or no
Sort : sorting order based on column name
columns : Columns name to show in the result
userbinding: Data will show to logged in user or guest user, option can be yes or no

A custom template can be uploaded to theme folder also, here is the folder path: wp-content/themes/your-theme/o365-display/sp-search/views/
Please change the your-theme name with your currently active theme name.

How to get Site and Drive ID

User Microsoft Graph Explorer (https://developer.microsoft.com/en-us/graph/graph-explorer#) to get the site and DriveID

Get all sites

https://graph.microsoft.com/v1.0/sites?search=*

Get DriveID based on SiteId

https://graph.microsoft.com/v1.0/sites/{site-id}/drives (Replace {site-id} with your desired site id that grabbed from previous results)

Get ItemID based on SiteId and DriveId

https://graph.microsoft.com/v1.0/sites/{site_id}/drives/{drive_id}/root/children Replace site_id, drive_id

Get Folders data

https://graph.microsoft.com/v1.0/sites/{site_id}/drives/{drive_id}/items/{folder_id}/children




Back To Top