Question

I am using SharePoint Online with modern pages (cannot enable the publishing feature, so no classic pages allowed).

Is there any way to embed a custom html site, code or an aspx site kept as a file on the SharePoint?

I've already tried using the "embeded" web part, but it forces a download and does not show a preview.

Essentially I need to be able to insert a clickable image, ideally an styled html document.

Was it helpful?

Solution

Please do not use the direct link for the html file since it does not open directly from SharePoint. Use the link for the preview mode of the page, which should be formatted as

https://<tenant>.sharepoint.com/sites/<sitename>/SiteAssets/Forms/AllItems.aspx?id=%2Fsites%2F<sitename>%2FSiteAssets%2F<filename>%2Ehtml&parent=%2Fsites%2F<sitename>%2FSiteAssets

This link can use for preview in the embed code, but it carries the too bar in the web part as well:

<iframe src="<Link>" width="1000" height="800"></iframe>

enter image description here

In addition, you can convert the html file to aspx so it can open directly from SharePoint.

You can also refer to a similar post here for another suggestion: How do I call custom pages from Site Assets?

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top