Help - Search - Members - Calendar
Full Version: Name attribute
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
btrott
Not quite true, actually; that is describing the generic "type" NAME or ID, to be used in constructing the specs for HTML tags. In the spec for the A element, you see the following:

CODE
 name        CDATA          #IMPLIED  -- named link end --


So the "name" attribute value is actually CDATA and can thus contain pretty much anything (AFAIK).

And in fact, if you try to validate <a name="513209"> as HTML 4.01 or X-HTML, it reports no errors.
btrott
True... but I wouldn't say that anyone who wishes to use "id" is out of luck, necessarily--you can edit the permalinks in the templates just as easily as you can edit the <a> tags, so it shouldn't be that much work to change over to use the other scheme.
kgish
According to the HTML 4.01 specifications, it is an error to start the NAME or ID tags with a digit. For example, in the default templates that MT provides at installation, the following  is used:
CODE
<a name="<$MTEntryID pad="1"$>"></a>

According to the specifications, something similar to the following would be more preferable:
CODE
<a name="mt_<$MTEntryID pad="1"$>"></a>

For the sake of future compatability, that is.

For more information, please see: http://www.w3.org/TR/html4/types.html#type-cdata

"ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). "

Just trying to make a really great product even better.
cavlec
You're right that the name attribute is CDATA, but...

... anyone who cares to use an id attribute rather than <a name=""> is out of luck with the current naming scheme. I would like to do so -- I'm an SGMLer at heart -- but I'm about to go back and change my templates, because I can't tease valid XML IDs out of MT's naming scheme.

Automatically prepending a letter ("e" for "entry" perhaps?) to entry names wouldn't negatively affect anyone, would it? If it's possible, I would certainly appreciate it.

Just getting started with MT -- it's been great! Thanks!

-cavlec
cavlec
Still learning... didn't realize that was possible. I'll give it a try. Thank you!

-cavlec
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.