Domanda

I have been tasked with creating a small website using SharePoint 2010 Site Pages via SharePoint Designer. I am bringing over my favorite html template, which loads and runs as expected (mostly), but I quickly ran into the following problem.

I typically use PHP to inject certain data into my page by reading directly from a local file. I have no experience with ASP, which appears to be the only method to accomplish this. I have searched the docs and so many sites but haven't found a clear-cut way to do this, and now my head is spinning. Can anyone help me with a simple process for reading a file into the middle of my html file as it gets served?

For example:

<html>
<body>
Here's my title
<inject file contents here>
Here's my footer
</body>
</html> 

Thanks all, any help will be much appreciated!

È stato utile?

Soluzione

You cannot do this out of the box. You will have to create a customised solution to do this, by implementing a custom controls for instance.

When you start using Sharepoint you need to change your mindset about whatever you used before. Believe me you don't want to pick a fight with Sharepoint, because the beast will win.

back to your problem I think you should be looking at Reusable Content.

Here is a description about it:

http://en.share-gate.com/blog/sharepoint-reusable-content-a-forgotten-beauty

Basically you have a list where you manage all your reusable content bits (sort of like your files).

And then in the Rich text editor for the page content you can then insert a snippet that inject your reusable content.

if the content changes all the places you are using the reusable content bits will also change.

So this behaviour is pretty much the same you get if using a file. Except it's the SharePoint Way.

Good luck

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top