Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

CascadeVar

Summary:
Version: 2007-02-18
Prerequisites:
Status:
Maintainer: Pm
Categories:

Questions answered by this recipe

Description

    The CascadeVar() function is intended to be used as a helpful
    function to define page variables that are drawn from page
    text variables defined in specific pages.  This makes it easy 
    to create page variables that can have default values that 
    can be overridden by authors for a specific page, group, or site.

    CascadeVar() will use the pages in $CascadeVarPathFmt,
    which will look in the current page, the GroupAttributes page,
    and the site's GroupAttributes page for the value of a given 
    page variable.  If not located in any of these sources, then
    the $CascadeVar array is used.

    To use this function, simply define a page variable in $FmtPV
    that calls the CascadeVar() function with a page name and
    the name of the page text variable to be used as a cascade
    variable.  For example, to have $BannerTitle come from
    $:BannerTitle in the current page, GroupAttributes, or 
    Site.GroupAttributes, one would define:

        $FmtPV['$BannerTitle'] = 'CascadeVar($pn, "BannerTitle")';

Notes

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

Comments

See Also

Contributors

Edit - History - Print - Recent Changes - Search
Page last modified on January 02, 2008, at 07:45 PM