GetBaseTagData

Description

Returns an object that contains data (variables, scopes, and so on) from an ancestor tag. By default, returns the closest ancestor. If there is no ancestor by the specified name, or if the ancestor does not expose data (for example, cfif), an exception is thrown.

Category

Other functions

Syntax


GetBaseTagData(tagname [, instancenumber ] ) 

See also

GetBaseTagList

Parameters

Parameter
Description
tagname
Required. The ancestor tag name for which the function returns data.
instancenumber
Optional. The number of ancestor levels to jump before returning data. The default is 1.

Example

<!--- This example illustrates usage of the GetBaseTagData

   function. This is typically used in custom tags. --->

...

<cfif trim(inCustomTag) neq "">

    <cfoutput>

      Running in the context of a custom

      tag named #inCustomTag#.<P>

    </cfoutput>

    <!--- Get the tag instance data --->

    <cfset tagData = GetBaseTagData(inCustomTag)>

    <!--- Find out the tag's execution mode --->

    Located inside the 

    <cfif tagData.thisTag.executionMode neq 'inactive'>

      template

    <cfelse>

      BODY

    </cfif>

...





Banner.Novgorod.Ru