- Publicity: Public Only All
style-procs.tcl
Template style handling
- Location:
- packages/acs-templating/tcl/style-procs.tcl
- Author:
- Gustaf Neumann
Procedures in this file
- template::icon (private)
- template::icon::name (public)
- template::iconset (private)
- template::toolkit (private)
Detailed information
template::icon (private)
template::icon -name name [ -alt alt ] [ -class class ] \ [ -iconset iconset ] [ -style style ] [ -title title ] \ [ -invisible ]
Return a dict containing the HTML rendering and a potentially needed command for the ADP code. The latter are necessary for e.g. style loading. The target icon can be (1) a font glyph, (2) an image or (3) just a text. Method (1) is used for glyphicons and bootstrap icons, which is signaled by a value in the icon::map starting with a plain character. When the value starts with a slash "/", then an image will be used. When the name has no graphical counterpart (variant 3), this is signaled via an empty string. In this case, the resulting replacement will be the value of "alt" in text form. The configuration of this method is performed via the Tcl dict ::template::icon::map, which is set in tag-init.tcl
- Switches:
- -name (required)
- -alt (optional)
- used in classic images. When not specified, use 'title' attribute
- -class (optional)
- -iconset (optional)
- force isage of this icon set
- -style (optional)
- -title (optional)
- -invisible (optional, boolean, defaults to
"f"
)- Returns:
- dict containing 'HTML' and 'cmd'
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- adp_parse_tags
template::icon::name (public)
template::icon::name [ -iconset iconset ] name
Return for the provided generic name the name in the specified or current iconset the name mapping. This function is necessary in boundary cases, where e.g. a display_template passes the generic name of the icon via template variables which have to be
- Switches:
- -iconset (optional)
- Parameters:
- name (required)
- Returns:
- mapped icon name or the passed in generic name
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::iconset (private)
template::iconset [ -subsite_id subsite_id ]
Return the configured or derived icon set. Potential results are "classic" (old-style gif/png images), "glyphicons" (Part of Bootstrap 3), "fa-icons" (usable for all themes), and "bootstrap-icons" (usable for all themes).
- Switches:
- -subsite_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::toolkit (private)
template::toolkit [ -subsite_id subsite_id ]
Return the CSS toolkit or empty the current or given subsite. Potential result values are "" (undetermined) "bootstrap" (for Bootstrap 3), "bootstrap5" (for Bootstrap 5), or "w3css".
- Switches:
- -subsite_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.