Mar 07 2018 02:36 AM
Mar 07 2018 02:52 AM - edited Mar 07 2018 03:25 AM
SolutionOne way is to use the PageContext object as described in the following article:
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/connect-to-sharepoint
AFAIK the context object is also available in an Extension. The property pageContext.web.title contains the name of the site.
PnP-JS-Core also provides easy access to a lot of functionality and properties of SharePoint objects, have a look at it here:
https://github.com/SharePoint/PnP-JS-Core
Mar 07 2018 05:23 PM
Mar 07 2018 11:59 PM
How would I go about add the absoluteURL in a .scss file like so:
background: url("$this.props.context.pageContext.site.absoluteUrl/Shared%20Documents/Banner/MissionJapanBanner.png") center center no-repeat
Thanks !
Mar 07 2018 02:52 AM - edited Mar 07 2018 03:25 AM
SolutionOne way is to use the PageContext object as described in the following article:
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/connect-to-sharepoint
AFAIK the context object is also available in an Extension. The property pageContext.web.title contains the name of the site.
PnP-JS-Core also provides easy access to a lot of functionality and properties of SharePoint objects, have a look at it here:
https://github.com/SharePoint/PnP-JS-Core