Skip to content

Instantly share code, notes, and snippets.

@JamoCA
Last active July 31, 2025 23:52
Show Gist options
  • Save JamoCA/8bb3ea051f9c87564107337c3e5d1f49 to your computer and use it in GitHub Desktop.
Save JamoCA/8bb3ea051f9c87564107337c3e5d1f49 to your computer and use it in GitHub Desktop.
Check current template invocation mechanics (include vs module)
<!---
7/31/2025
Related to Adobe Tracker bug report CF-4227330 (https://tracker.adobe.com/#/view/CF-4227330)
--->
<!--- Add this check to the top of the script in case it's called using cfscript
or it will be executed twice as "self-closing cfscript" doesn't appear to be supported. --->
<cfif isdefined("thisTag.executionMode") && thisTag.executionMode eq "end">
<cfexit>
</cfif>
<cfif isdefined("thisTag.executionMode")>
<p>This script is being called as a CFModule (and not as a CFInclude).</p>
</cfif>
<cfoutput>
<p>getCurrentTemplatePath() = #getCurrentTemplatePath()#<p>
</cfoutput>
<cfset callStack = callStackGet()>
<cfdump var="#callStack#" label="callStack">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment