Now with XHTML-compliant fragment identifiers

iStock_000002393284XSmall

This is something that Laura from T4 mentioned in the T4SMACAD-L mailing list a couple of months ago that I’ve found useful and have enabled on our version of 6.2.0033 at the University of St Andrews.

As of Site Manager 6.2.0033 and 7.0.0010 the T4 meta tags with a type of html_anchor now have an XHTML-compliant option so that you can use the id attribute rather than the name attribute.

Environment variables

To enable the XHTML-compliant option you need to add two new variables on the Environment Variables page and then set them both to true. The new variables are:

  • xhtml-output
  • xhtml-strict-output

Example

So, for example:

<t4 type=”meta” meta=”html_anchor” />

might generate this fragment identifier:

<a name=”d.en.123”></a>

With the new XHTML-compliant options enabled it would now generate this:

<a id=”d.en.123”></a>

This is good news for those who don’t like to use the older ‘name’ attribute.

Option to choose which element would be nice

Prior to HTML 4 the only way to create a fragment identifier was to to use the name attribute on an anchor tag <a>.

As of HTML 4 practically any element can be used, with an id attribute. Being picky now, it’s just a shame there isn’t a further option to allow you to specify the element that you would like the fragment identifier to be an attribute of, e.g. an empty <div> for example.

That said, this is a welcome addition.

About these ads

About Gareth J M Saunders

Hi, I'm Gareth J M Saunders, 6' 4", married to Jane, father of 3 boys (twins and singleton), I'm a priest in the Scottish Episcopal Church, employed as the Web Architect at the University of St Andrews. My main interests are HTML, CSS (inc. frameworks), jQuery, Information Architecture and Agile development.
This entry was posted in SiteManager and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s