You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the addLink() method in the HTMLHelperProperty, passing in type=canonical, the output will always return something of the following variety:
<cffunction name="addLink" access="public" returntype="string" output="false"
hint="Adds code for a link tag for inline use or in the HTML head.">
<cfargument name="type" type="string" required="true"
hint="The type of link. Supports type shortcuts 'icon', 'rss', 'atom', 'html' and 'canonical', otherwise a complete MIME type is required." />
<cfargument name="href" type="string" required="true"
hint="The href path to a web accessible location of the link file." />
<cfargument name="attributes" type="any" required="false" default="#StructNew()#"
hint="A struct or string (param1=value1|param2=value2) of attributes." />
<cfargument name="outputType" type="string" required="false" default="head"
hint="Indicates to output type for the generated HTML code ('head', 'body', 'inline'). Link tags must be in the HTML head section according to W3C specification. Use the value of inline with caution." />
When using the addLink() method in the HTMLHelperProperty, passing in type=canonical, the output will always return something of the following variety:
<link rel="canonical" type="http://www.foo.com/bar" />
The spec on the tag suggests that the format should include a rel attribute but no type attribute, a la:
<link rel="canonical" href="http://www.foo.com/bar" />
I've created a fix for myself locally by updating the addLink() method with the code below. Unsure if this is the best approach but it works for me.
I'm on
Version: 1.9.0.2823 (Integrity)
Built-on: 2011-07-08 02:11:51
Using Railo 3.3.4.003 final
For reference:
http://en.wikipedia.org/wiki/Canonical_link_element
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394
<cffunction name="addLink" access="public" returntype="string" output="false"
hint="Adds code for a link tag for inline use or in the HTML head.">
<cfargument name="type" type="string" required="true"
hint="The type of link. Supports type shortcuts 'icon', 'rss', 'atom', 'html' and 'canonical', otherwise a complete MIME type is required." />
<cfargument name="href" type="string" required="true"
hint="The href path to a web accessible location of the link file." />
<cfargument name="attributes" type="any" required="false" default="#StructNew()#"
hint="A struct or string (param1=value1|param2=value2) of attributes." />
<cfargument name="outputType" type="string" required="false" default="head"
hint="Indicates to output type for the generated HTML code ('head', 'body', 'inline'). Link tags must be in the HTML head section according to W3C specification. Use the value of inline with caution." />
</cffunction>
The text was updated successfully, but these errors were encountered: