Main Points

Here are some additional notes about implementing the ASP.NET nested master page template across the site. There was nothing else to insert here, and the final master page templates are also available for you to see. We have a template for each style of page, here's the XHTML output from our core page template based on master pages and our testing page template too. This page is also based on the new template, but includes some historical notes on little issues that came up when applying it across the websites.

Structuring Test Pages

Unexpectedly, I have instituted a small change since version 11. I am trying to keep a commented section in the ASP.NET template so that optional code can be easily used, deleted, or if necessary incorporated back into old pages. This commented section works fine in IE and Opera. However, in Firefox, the double dash that was in version 11 of the forward and back links creates problems. In IE and Opera the double dash must be followed by a greater than sign to close the comment, -->. In FF the greater than sign doesn't have to immediately follow the double dash, in fact this is enough to close a comment: -- ...lots of stuff... <tag>. Everything after that tag becomes visible on the page in FF. To avoid this, I've had to get rid of the double dash, which meant abandoning my slightly cobbled together but highly robust arrows, <-- and -->, with slightly less robust escape code arrows, ← and →. I think this will be more attractive anyway, and there don't seem to be many cases where they don't work. It's more important that the comments work than to preserve any particular arrow convention, so that's how I'm going after this for now.

I'm also adjusting some of the code on the test pages. I wanted to do as little of this as possible, but navigation and for the first time SEO both demand some modest accomodations to certain links. I'm thinking about how to differentiate these links as active "safe" links, possibly as part of differentiating a test page from the other pages of the website in general. Should it be the test pages that are tagged or the normal pages to avoid "adjustments" to the test and content review pages? This really touches on the fact that Core pages should be set up similar to pages on any other website so that they can be updated. But the test pages should be fundamentally frozen. Maybe create folders for CSS, Components, etc. and when I make changes to the Core page template, then it becomes a new update in those files and I begin using that new "frozen" page instead of the old "frozen" page in future testing pages. This will allow a javascript to be used for a year (or more) if there are no changes, while numerous updates to a CSS stylesheet can be reflected in the test pages. {chroniclemaster1 2008/12/27: The links evolved into the working link color for the test pages which otherwise are as much as possible created to mimic their final application as closely as possible. The core pages have details in red to distinguish them. I also moved the entire present file structure into a Historical folder and rebuilt the file paths a bit to reference the new location. I've not yet implemented the new testing structure for source files but am more certain that I will implement something like this.}

It became apparent at some point, that our method of inserting a <title> tag into a content control in the <head> was generating two <title> tags. I would prefer a cleaner implementation like I had, the .NET version makes lousy use of whitespace (like so many controls). However, if .NET is going to implement it's own title tag even if I don't call it, then I guess best practices is to use the ugly one. I've therefore redone these templates without the <title> tag in the content control and adding the Title attribute to the @Master directive.

[chroniclemaster1, 2009/04/14]

Skip to Main Points

Master Page Modified Principles

I've also made one small but critical change to the Master Page philosophy. In master page 2 when I first started I used two principles to pull items out to the content page: the pieces of the webpage had to change and they had to be semantically intact. If I removed an opening tag, its closing tag - and therefore everything in between - had to come with it. I have developed one exception to this. I wanted to apply an id to the body tag as hook when I needed to attach CSS for page specific styling. When I had to actually do this for the Test Page and the Website Log, I realized that the body tag was hard coded. I therefore decided that I could modify my principles to include inserting only the specific opening tag, not a section, not additional text, only the individual opening tag. Like so...

<asp:contentplaceholder id="cphBodyTag" runat="server">
<body>
</asp:contentplaceholder>

This will allow me to insert custom body tags into the content page. Obviously to facilitate that, the nested master page has a content tag which corresponds to this placeholder. The only thing within it is the identical contentplaceholder above except that the id="cphInsertBodyTag". This provides the link in the chain down to the level of the ASP.NET content page. I can define a content section that attaches and has the page name as an id for the body tag and then write CSS against it without affecting any other page. However, I can also leave the content tag completely out of the content page and then ASP.NET will supply a generic <body> tag by default from the nested master page.

Also, Master pages should reference everything by app root relative links of some form. (tilde or forward slash technique, whatever works) This is the only way to ensure they work from whatever folder or subfolder they are called from.

Content pages are harder. References to other items in their section should be by relative paths to make sure folders can be moved around most easily later and preserve the integrity of those path references. However, items which are in fairly static folders relative to the root (primary image folders, css / js files, master pages, etc. should be referenced with an app root relative path. (either forward slash or tilde)

Skip to Main Points
<---- Jump back to Master Page Development