View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > GetBaseTagList PreviousNext

GetBaseTagList

Gets ancestor tag names, starting with the parent tag.

A comma-delimited list of uppercase ancestor tag names, as a string. The first list element is the current tag. If the current tag is nested, the next element is the parent tag. If the function is called for a top-level tag, it returns an empty string. If an ancestor does not expose data (see GetBaseTagData), its name might not be returned.

Other functions

GetBaseTagList()

GetBaseTagData

This function does not display the following tags or end tags in the ancestor tag list:

This function displays the following tags only under the following conditions:

<!--- This example shows the use of GetBaseTagList function. 
Typically used in custom tags. --->
<cfif thisTag.executionMode is "start">
   <!--- Get the tag context stack 
   The list will look something like "CFIF,MYTAGNAME..." --->
   <cfset ancestorList = GetBaseTagList()>
    <br><br>Dump of GetBaseTagList output:<br>
   <cfdump var="#ancestorList#"><br><br>
   <!--- Output current tag name --->
   <cfoutput>This is custom tag  #ListGetAt(ancestorList,1)#</cfoutput><br>
   <!--- Determine whether this is nested inside a loop --->
   <cfset inLoop = ListFindNoCase(ancestorList, "cfloop")>
   <cfif inLoop>
      Running in the context of a cfloop tag.<br>
   </cfif>
</cfif>

Contents > CFML Reference > ColdFusion Functions > GetBaseTagList PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


Dorian_Laird said on Feb 9, 2005 at 4:39 AM :
Please review the Example Code.

Documentation of the Tag: This function does not display the following tags or end tags in the ancestor tag list: cfif, cfelseif, cfelse

Comment at ExampleCode: The list will look something like "CFIF,MYTAGNAME..."

The list will more look like something: "MYTAGNAME..." - CFIF is not shown.

:-)

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi88.htm