0

Our new site is made entirely with HTML and we are pleased with how it is progressing. The pages contains links to various sharepoint libraries which is fine. But on the home page we want the ability to add a list as announcements. Can a sharepoint list and library be embedded into a html page? We also want to make a search box on the page that will search our sharepoint site.

The html files are all being hosted through sharepoint at the moment.

1

Can a sharepoint list and library be embedded into a html page?

Not really. SharePoint is built on ASP.NET, which means that when a SharePoint page is served up, there's a lot of server-side processing that happens to generate the final HTML that gets sent to the client.

Plain .html files do not go through the .NET pipeline, they just get served up as-is, straight to the client. So if you were to try and embed a web part or something on a plain HTML page, there's no point where the server is looking at that file and processing it and saying "oh hey, look, I see there's a web part on this page, let me do what I need to do to generate the HTML for this."

That's not to say you can't get data from a list or library on your HTML page - you just can't do it using a List View Web Part (or any other SharePoint web part). What you would have to do is write all the code yourself to fetch the data from SharePoint, and then insert and display the data retrieved on your page.

  • Thank you. I will abandon all hope for that then. I wrongly assumed it would be an easy task, (PS, I HATE how enter posts the message.) – Darkstar.Industries Aug 21 '18 at 20:44
  • @Darkstar.Industries you don't have to abandon all hope, you tagged your question with jquery, it wouldn't be so hard to make a couple jQuery AJAX calls to the SharePoint REST api, and then use jQuery to add that data to your page. You just don't instantly get all the bells and whistles of a LVWP (like sorting and filtering). – Dylan Cristy Aug 21 '18 at 23:23
0

You would need to switch away from your HTML pages to using SharePoint master pages and page layouts/content pages in order to do what you want. A lot of your HTML can be reused in a custom master page and page layout file(s), but it will take some time to make the conversion over, especially if you have extensive CSS code built out for your design. The CSS will have to be partially reworked to accommodate SharePoint html and CSS classes.

  • I see. So it is rather complex to convert my html file I assume then? I basically want a page which has the settings cog and my 2 web parts from sharepoint. The rest is from my html page. Which is now .aspx. – Darkstar.Industries Aug 22 '18 at 5:54
  • It really depends on your comfort level with coding. I do custom branding all of the time, so I don't see it as complex. There is a lot of baggage that comes with SharePoint but once you get used to working with the code it can be pretty easy. If all you want is the settings cog and those two web parts, do not go down the road working with Design Manager. It won't give you what you need. You would have to do custom branding development. – Heather Solomon Aug 22 '18 at 16:42
  • Well currently I've had to go guerilla style. I've striped out everything I don't want from a custom master page so it's basically cog. Then I've added a page viewer part to pull in my html file. This way I can have my web parts. It's not perfect and causes some issues when resizing etc. But so far it works. – Darkstar.Industries Aug 22 '18 at 19:12
  • I would encourage you to drop the page viewer web part and just put the HTML in your master page. – Heather Solomon Aug 22 '18 at 21:13
0

You can put your list in an iframe and link with ?IsDlg=1 parameter. This will show only the list itself and ribbon. If you want to hide the ribbon, just use css.

https://<yoursite>/Lists/<ListName>/AllItems.aspx?IsDlg=1

(PS: Parameter ?IsDlg=1 works for most things in SP)

  • Nice, this looks promising. One issue however is the embedded list shows tabs, search box and view changer in the iframe. Any way to hide and just show the list items? – Darkstar.Industries Aug 23 '18 at 6:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.