Page 1 of 1

Incorrect behavior of title attribute in {cms_selflink}

Posted: Mon Sep 28, 2009 8:17 am
by studip101
Hi all,

The {cms_selflink} tag uses the linked page's name for the title attribute if no title is provided as a parameter to the tag or in the page's description field. In my opinion, this is the wrong behavior. To quote the W3C: "The title attribute is used to provide additional information to help clarify or further describe the purpose of a link."

Therefore, if the linked page has an empty description field (i.e. the title attribute will default to the page name), I believe the tag should function as follows:
  • If the link text contains (or is the same as) the page title, regardless of whether the user provided provided the link text explicitly or if it was set automatically (i.e. they only provided a page alias/id), no title attribute should be shown, unless title text is explicitly provided.
  • If the link text does not contain the page title, the title attribute should default to the page title, but be disable-able by a parameter.
Let me know what you guys think!

EDIT: I realize that these problems can usually be bypassed by setting the tag to only return the link's href, but that's not the point. I'm sure there are still cases where this would be helpful and, in my mind, if it's incorrect, it should be fixed.

Re: Incorrect behavior of title attribute in {cms_selflink}

Posted: Sun Jan 06, 2013 5:57 pm
by Rolf
Changed in SVN rev. 8625

Thanks, Rolf