SharePoint Library for WordPress

Use this guide, if you want to embed a SharePoint Online Library experience in a WordPress page or post. Also see the following video https://youtu.be/qK27HCGXhfU

The Documents app gives companies that use WordPress as their intranet platform of choice a simple solution to offer employees the ability to surface files in a (folder in a) SharePoint Online or (personal) OneDrive library.

The WPO365 | LOGIN plugin includes a basic version of the Documents app. Intranet managers that require the ability to navigate into (sub) folders or a personal OneDrive, however, can obtain an advanced version of the app through the WPO365 | M365 extension of WPO365 | INTRANET bundle.

Before you start

  • You must already have configured the single sign-on capability of the WordPress + Office 365 plugin.
  • Additionally, you must also already have configured the integration capability of the plugin.
  • You are a Global Administrator for your company’s Office 365 tenant / Azure AD directory (or have at least the ability to edit the Azure Active Directory App registration that was created previously when the single sign-on capability was configured).
  • You are an Administrator for your WordPress website.

App registration

  • In Azure Portal click the 'hamburger' (icon with three horizontal lines in the upper corner) to open the menu.
  • Navigate to Azure Active Directory > App registrations.
  • Select the App registration that you created when you configured the single sign-on capability of the plugin.

API Permissions

  • Click API permissions from the 'App registration' menu on the left
  • Click + Add a permission.
  • Select Microsoft Graph > Delegated permissions.
  • Check
    • Sites.Read.All
  • Click  Add permissions.
  • Click Grant admin consent for … as an administrator for to grant consent for all users in your tenant to use this ‘App registration’.

Please note Since you are granting so-called delegated permissions users will only be able to access files they have been granted access to. The name Sites.Read.All may be a bit misleading in this case.

Integration

  • Navigate to WP Admin > WPO365 > Integration.
  • Click Delete tokens.
  • Click Save configuration.
  • Sign out of your WordPress website.
  • Now sign in again with Microsoft.

Please note Deleting tokens and then signing out and in again will ensure that the access token that the plugin retrieves on your behalf has all the right permissions. It may also be a good idea to clear your browser's cache for the website.

Generate a Documents short code

To generate a short code to embed the Documents (SharePoint / OneDrive) app into any WordPress page or post, navigate to WP Admin > WPO365 > ... > Documents (SharePoint / OneDrive) and configure (some of the) following options.

Basic edition
  • Hostname is where you enter the hostname portion of your tenant's SharePoint Online instance. For example, if your SharePoint Online home address is https://wpo365demo.sharepoint.com you would enter here wpo365demo.sharepoint.com (without https:// at the beginning and trailing slash at the end).
  • Server relative path library is where you enter the server relative portion of the SharePoint Online Site where the library that you'd like to publish resides. For example, if the library you'd like to publish in WordPress can be found in the site with address https://wpo365demo.sharepoint.com/sites/contoso then would enter here sites/contoso.
  • Library title is where you enter the title of the list that you want to publish in WordPress e.g. Documents.
  • Columns is where you can remove columns from being displayed and optionally change their caption.
  • Translations allows you to translate the default messages in your companies own language and speak.
  • Hide message bar will hide the corresponding element when checked and as such would prevent end users from seeing error and warning messages. 
  • Click Copy short code to clipboard.

Intranet edition

  • Datasource Allows you to select the datasource for the Documents app as follows:
    • A SharePoint library
    • The logged-in user's OneDrive
    • The logged-in user's Recent documents
  • Hostname is where you enter the hostname portion of your tenant's SharePoint Online instance. For example, if your SharePoint Online home address is https://wpo365demo.sharepoint.com you would enter here wpo365demo.sharepoint.com (without https:// at the beginning and trailing slash at the end).
  • Server relative path library is where you enter the server relative portion of the SharePoint Online Site where the library that you'd like to publish resides. For example, if the library you'd like to publish in WordPress can be found in the site with address https://wpo365demo.sharepoint.com/sites/contoso then would enter here sites/contoso.
  • Library title is where you enter the title of the list that you want to publish in WordPress e.g. Documents.
  • Folder (relative path or empty for root) is where you can enter the title of folder in the library to limit navigation to that folder and the folders below it.
  • Columns is where you can remove columns from being displayed and optionally change their caption.
  • Translations allows you to translate the default messages in your companies own language and speak.
  • Hide message bar will hide the corresponding element when checked and as such would prevent end users from seeing error and warning messages. 
  • Click Copy short code to clipboard.

Embed a Content by Search (SharePoint) app in a WordPress page or post

Perform the following steps to embed the Documents (SharePoint / OneDrive) app in a WordPress page or post after you clicked to Copy the short code to clipboard.

  • From the WordPress Admin Bar, click + New to add a new WordPress page or post.
  • On the page or post, type short code in the block navigator and click the short code shortcut to add a new short code block to the page or post.
  • In the short code editor, click Ctrl+V (or right mouse click and click Paste) to paste the short code.
  • Publish the page and then click View post to check the result.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us