I am trying to publish the same information about opening hours for my organisation across 4 different webpages:
Internet sites (public):
- English website: Opening hours in English
- Danish website: Opening hours in Danish
Intranet sites (requires login):
- English website: Opening hours in English
- Danish website: Opening hours in Danish
To avoid having to update four web pages each time my opening hours change, I would like to have my opening hours listed in one single document (iframe.html) which is loaded as an iframe from the above 4 sites.
On each of the 4 websites (websiteX.html) I would like to:
- Set the language in which I would like my opening hours to display
- Load iframe.html and have it display my opening hours in the language set and hide the opening hours in the language which is not set.
I imagine the structure of iframe.html to look something like:
<div class="english">
Opening hours in English
</div>
<div class="danish">
Opening hours in Danish
</div>
I imagine the solution to this problem requires:
- CSS and JavaScript in websiteX.html to set the language and display (hidden/shown) for the English/Danish sections of iframe.html
- JavaScript in either websiteX.html and/or iframe.html to ensure that the option set in websiteX.html is inherited/pushed correctly to/from iframe.html so that the correct of iframe.html will be shown to the user.
I have not been able to find a solution to this problem and am unfortunately clueless about how to build a solution from the bottom myself.
Any help would be much appreciated.