Ignorance Is Bliss
Chaining Master Pages together is useful but only benefits the visitor when we give them something to see. As we don't really expect our visitors to access Master Pages directly and glean anything useful from them, we must add resource documents to the end of the chain. This is fortunately extremely easy to do because we have already learned how to do this!
In continuing with our contrived tutorial, we will add the following HTML5 file to our fictional site:
This resource document needs only be concerned with its immediate Master Page. Once it has content that is wrapped in an appropriate SSI-Filler directive DIV and a properly formed SSI-Template directive META, the fact that its Master Page happens to chain into other Master Pages is of no consequence to this particular file.
Results
When visitors access this page at http://your-site/section1.html, they should see something very much like:
Not exactly pretty, but this is an ultra-simplified tutorial. What is important here is that so little HTML was written into this resource document to gain so much content, thanks to HTML Master Pages and this chained Master Page setup. If you have been following along, the resulting source code for this output shouldn't contain any surprises:
Analysis
A quick recap:
- The
HEAD
tag of our resource document (
section1.html
) was merged with that of its Master Page (section-master.html
), which was then merged with the HEAD tag of its immediate Master Page (site-master.html
). - The SSI-Filler DIV tags in our resource document
(
section1.html
) fully replaced the matching SSI-Container DIV tags in the resource document's Master Page (section-master.html
). - The SSI-Container DIVs that were replaced in this
intermediary
Master Page (
section-master.html
) where themselves wrapped in SSI-Filler DIV tags that -- now carrying content from our resource document -- fully replaced matching SSI-Container DIV tags in that Master Page's immediate Master Page (site-master.html
). - The result is the final merged document as seen in Figure 9 and Figure 10, wherein our merge chain has fully resolved, adding rich content to an otherwise plain document.