template::CSS proc require_toolkit (public)

 template::CSS[i] require_toolkit [ -css ] [ -js ]

Defined in packages/xotcl-core/tcl/01-debug-procs.tcl

Make sure that the preferred toolkit is loaded. Note that some combination won't match nicely, since e.g. the toolbar of a theme based on bootstrap5 is messed up, when the preferred toolkit is bootstrap3. .... so, we should have some default setting or fallbacks to handle such situations.

Switches:
-css (optional)
-js (optional)

Testcases:
No testcase defined.
Source code:
#
# Make sure that the preferred toolkit is loaded. Note that some
# combination won't match nicely, since e.g. the toolbar of a
# theme based on bootstrap5 is messed up, when the preferred
# toolkit is bootstrap3. .... so, we should have some default
# setting or fallbacks to handle such situations.
#
if {${:preferredCSSToolkit} eq "bootstrap5"} {
    if {$css} {::template::head::add_css -href urn:ad:css:bootstrap5}
    if {$js}  {::template::head::add_javascript -src urn:ad:js:bootstrap5}
} elseif {${:preferredCSSToolkit} eq "bootstrap"} {
    if {$css} {::template::head::add_css -href urn:ad:css:bootstrap3}
    if {$js}  {::template::head::add_javascript -src urn:ad:js:bootstrap3}
} else {
    # YUI has many simple files, let the application decide what
    # to be loaded.
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: