Lucee Tag Reference

<cfhtmlhead>

Writes the text specified in the text attribute to the 'head' section of a generated HTML page. The cfhtmlhead tag can be useful for embedding JavaScript code, or placing other HTML tags such, as META, LINK, TITLE, or BASE in an HTML page header.

Body

This tag may have a body.

Example

<cfhtmlhead
[action=append|read|reset|write]
[force=boolean]
[id=string]
[text=string]
[variable=string]>
[</cfhtmlhead>]
This tag is also supported within cfscript
<cfscript>
htmlhead
[action=append|read|reset|write]
[force=boolean]
[id=string]
[text=string]
[variable=string] {
[...]
}
</cfscript>

Attributes

The attributes for this tag are fixed. Except for the following attributes no other attributes are allowed.
Name Type Required Default Value Description
action string No append possible actions are:
  • append (default): append text to the html head
  • read: return the text already set to html head
  • reset: reset/remove text already set to hrml head
  • write: write text to html head, overwrite already existing text in html head
  • flush: writes the buffer in the html head to the response stream 
  • force boolean No if set to true, it works even within a silent block 
    id string No ID of the snippet that is added, used to ensure that the same snippet will not be added more than once. 
    text string No The text to add to the 'head' area of an HTML page. Everything inside the quotation marks is
    placed in the 'head' section 
    variable string No Name of variable to contain the text for htmlhead.