template::adp_level (public)

 template::adp_level [ up ]

Defined in packages/acs-templating/tcl/parse-procs.tcl

Get the stack frame level at which the template is being evaluated. This is used extensively for obtaining references to data sources, as well template objects such as forms and wizards

Parameters:
up (optional)
A relative reference to the "parse level" of interest. Useful in the context of an included template to reach into the stack frame in which the container template is being parsed, for accessing data sources or other objects. The default is the highest parse level.
Returns:
A number, as returned by [info level], representing the stack frame in which a template is being parsed.

Partial Call Graph (max 5 caller/called nodes):
%3 test_adp_level adp_level (test acs-templating) template::adp_level template::adp_level test_adp_level->template::adp_level Class ::Generic::Form Class ::Generic::Form (public) Class ::Generic::Form->template::adp_level Class ::xowiki::WikiForm Class ::xowiki::WikiForm (public) Class ::xowiki::WikiForm->template::adp_level ad_cache_returnredirect ad_cache_returnredirect (public) ad_cache_returnredirect->template::adp_level ad_form ad_form (public) ad_form->template::adp_level ad_set_element_value ad_set_element_value (private) ad_set_element_value->template::adp_level

Testcases:
adp_level
Source code:
    set result ""

    # when serving a page, this variable is always defined.
    # but we need to check it for the case of isolated compilation

    if { [info exists ::template::parse_level] } {
        if {$up eq ""} {
            set result [lindex $::template::parse_level end]
        } else {
            set result [lindex $::template::parse_level [llength $::template::parse_level]-$up]
        }
    }

    return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: