|
Elements In Depth : Auto-Generated Elements.
Elements automatically generates a few select elements (see Glossary) and makes them available to each page during processing. The auto-generated elements are:
currentDepth | fileExt | fileName | filePath | pageString | pathNames | pathNameStr | pathToTop | self | siteDest | siteSrc
-
currentDepth
Describes the folder depth of the current content page from the siteSrc. curentDepth is a number equal to the number of dots in pathNameStr (which is also the same as the number of "../" in pathToTop).
e.g. "1"
- fileExt
The extension of the current content file.
e.g. ".html"
- fileName
The name of the current content file minus the extension.
e.g. "generatedElements"
- filePath
The full path to the current source file.
e.g. "Nomad:Users:mike:nthwave:elements:htmlSrc:inDepth:generatedElements.html"
- pageString
The pageString is actually a Python list. Each list item contains one line of the content as it is being processed. Like all elements, in a script (see Glossary) context, the pageString is a global variable. To change the pageString, a script must declare the pageString variable a global.
- pathNames
A Python list containing each directory name below the siteSrc plus the fileName of the currently processsed page.
e.g. "['inDepth', 'generatedElements']"
- pathNameStr
Dot-delimited string of directories below the siteSrc plus the fileName of the currently processsed page.
e.g. "inDepth.generatedElements"
- pathToTop
Contains the relative path from the current page to the top of the siteDest (see Glossary)—one "../" for each level down. Use pathToTop in templates, scripts and other elements to create links from arbitrarily deeply nested pages to known assets and pages.
e.g. ../
It can be used in other elements for a link that works at any depth:
#bannerImage <img src="{pathToTop}images/banner.gif">
- self
A reference to the content page's class instance. See the scripts page for more info.
- siteDest
Full path to the top level destination directory to which Elements will write processed files.
e.g. "Nomad:Users:mike:nthwave:elements:elements"
- siteSrc
Full path to the top level source directory upon which Elements is operating.
e.g. "Nomad:Users:mike:nthwave:elements:htmlSrc"
top
|