Forum Discussion

jaread83's avatar
jaread83
Champion
7 years ago

Can I include external HTML files in my Community?

Hi all,

There is some parts of our community that we are trying to centralise (like the header and footer for example). On our other websites we have used PHP and JS to download a HTML file and include it in the page via ajax.

Is there a way that this can be done on Lithium Communities? It would be great to move away from having to update the same code over and over again in multiple places for different websites. Has anyone done anything like this before?

Many thanks,

Jack

  • And there is also the Lithium "fetcher", it has to be configured by Lithium support though, external HTML will then be made available with custom system settings. I don't know if there is any advantage over other approaches proposed here, but I have seen this in several instances.

  • ClaudiusH's avatar
    ClaudiusH
    Khoros Alumni (Retired)
    Hi Jack,
    I think you can also have Lithium pull and cache a certain web resource regularly in a custom component or macro which you can then include in a page layout or include via freemarker in another component to your liking. We used to do this while I was at Skype and we were caching a shared page header and footer from the .COM page in 15 languages.