• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Inserting a tag into <head> with application.cfm

New Here ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

We're keeping track of stats using the Urchin Tracking Module, and we're inserting the script dynamically using application.cfm, to make sure it hits all the pages.

The trouble is, it inserts it at the top, before the doctype, which throws our pages into quirks mode (in IE). Is there a way, using application.cfm to find, say, </head> and insert a the tracking module before it?

TOPICS
Advanced techniques

Views

497

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

That's would probably be the easiest. Thing is application.cfm loads first then the shell. Can you put it in the shell.cfm of your file? Or do a find and replace on "<head>" and replace with "<head> <cfinclude template="inc_google.cfm">"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

Thanks for your suggestions.

What is shell.cfm? I don't think we have one of those anywhere yet.

Is there an article somewhere on the best way to do a Find and Replace inside application.cfm?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

Why don't you include the doctype tag as part of your application.cfm.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 23, 2007 Jul 23, 2007

Copy link to clipboard

Copied

have a look at the cfhtmlhead tag

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 24, 2007 Jul 24, 2007

Copy link to clipboard

Copied

LATEST
Ah brilliant! Thanks a ton.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 23, 2007 Jul 23, 2007

Copy link to clipboard

Copied

Yes that is what cfhtmlhead is for

<cfsavecontent variable="UrchinScript">
<script src="/__utm.js" type="text/javascript"></script>
</cfsavecontent>
<cfhtmlhead text="#UrchinScript#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation