A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

How to store static html and related images (with relative paths)?

Vote:
 

Hiya,

I'm trying to store raw html in EPiServer for multiple sets of pages, each set having their own static files in subdirectories. How can I do this programatically in such a way that the images etc still load properly when the html is displayed by EPiServer?

The structure of one of the sets might look like this:

  • setfolder/
    • htmlfileA.html
    • htmlfileB.html
    • css/
      • styles.css
    • images/
      • piccy1.png
      • piccy2.png
    • js/
      • magic.js

 

Thanks

Tim Abell

I have a more detailed question about one of the approaches I've tried here: http://stackoverflow.com/questions/9929031/how-to-alter-the-prefixes-episerver-is-adding-to-src-attributes-in-html

#57845
Mar 30, 2012 12:26
Vote:
 

How are the page resources addressed?  Relative or absolute?  If relative, then I don't see any reason why this wouldn't work.  If you have a static HTML file in the Global VPP, then it would have a path of "/Global/my-file.html."  If you had a subdirectory of "css", then you could address the CSS as "css/my-file.css" and that should load (the browser would request "/Global/css/my-file.css").

#57849
Mar 30, 2012 13:55
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.