http://coldfusion.com logo
#cfml-general
Title
# cfml-general
d

Dave Merrill

04/14/2022, 5:17 PM
Can someone tell me if there's a way to use cfhtmlhead from cfscript in CF 2018? This doesn't work, says Variable CFHTMLHEAD is undefined:
cfHtmlHead(text="#arrayToList(aList)#<br>");
d

danmurphy

04/14/2022, 5:25 PM
Looks like just
htmlHead
maybe? https://cfdocs.org/cfhtmlhead
d

Dave Merrill

04/14/2022, 6:05 PM
That page says it's Lucee only.
And it doesn't work.
s

Scott Steinbeck

04/14/2022, 6:15 PM
you could add your own UDF to call it in script
Copy code
<cffunction name="cfHtmlHead">
    <cfhtmlhead attributecollection="arguments">
</cffunction>
d

Dave Merrill

04/14/2022, 6:17 PM
Yes I know, thanks, just curious if I was missing some syntax variant that actually works.
s

Scott Steinbeck

04/14/2022, 6:17 PM
not that i can see
a

Adam Cameron

04/14/2022, 6:19 PM
@Dave Merrill that code you gave does work in CF2018, and does not give an error.
s

Scott Steinbeck

04/14/2022, 6:20 PM
oops, i misspoke, i was looking at docs for cf10
a

Adam Cameron

04/14/2022, 6:20 PM
Yeah that syntax was introduced with CF11.
s

Scott Steinbeck

04/14/2022, 6:20 PM
and the codeblock above was posted in SO from…. @Adam Cameron!
Him. Don't trust him.
d

Dave Merrill

04/14/2022, 6:21 PM
Gah, my bad. This particular app is still cf9 (!!!), upgrading soon.
As you were all.
😆 1
a

Adam Cameron

04/14/2022, 6:23 PM
haha
OKw ell some of the code being in tags still is the least of yer worries, I reckon 😛
d

Dave Merrill

04/14/2022, 6:24 PM
mmm
this patch isn't tags, it's new. but actually(tm), I was going to use cfhtmlhead as a sleazy logger that could run inside some query code, but I have a much better solution I just hadn't pulled into this project, until now, so, yay.