template::head::add_css (public)

 template::head::add_css [ -alternate ] [ -crossorigin crossorigin ] \
    -href href [ -integrity integrity ] [ -lang lang ] \
    [ -media media ] [ -order order ] [ -title title ]

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

Add a link tag with relation type 'stylesheet' or 'alternate stylesheet', and type 'text/css' to the head section of the document to be returned to the users client. A given target stylesheet may only be added once; subsequent calls to add_css will replace the existing entry. This function is a wrapper around template::head::add_link.

Switches:
-alternate (optional, boolean)
sets the rel attribute of the link tag defining to 'alternate stylesheet' if set, sets it to 'stylesheet' otherwise
-crossorigin (optional)
Enumerated attribute to indicate whether CORS (Cross-Origin Resource Sharing) should be used
-href (required)
the href attribute of the link tag, e.g. the target stylesheet
-integrity (optional)
provide hash values for W3C Subresource Integrity recommendation
-lang (optional)
the lang attribute of the link tag specifying the language of its attributes if they differ from the document language
-media (optional, defaults to "all")
the media attribute of the link tag describing which display media this link is relevant to. This may be a comma separated list of values, e.g. 'screen,print,braille'
-order (optional, defaults to "0")
-title (optional)
the title attribute of the link tag describing the target of this link
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) template::head::add_css template::head::add_css test_xowiki_test_cases->template::head::add_css template::head::add_link template::head::add_link (public) template::head::add_css->template::head::add_link Class ::xowiki::formfield::FormField Class ::xowiki::formfield::FormField (public) Class ::xowiki::formfield::FormField->template::head::add_css Object ::template::CSS Object ::template::CSS (public) Object ::template::CSS->template::head::add_css Object ::xo::api Object ::xo::api (public) Object ::xo::api->template::head::add_css ad_html_text_convert ad_html_text_convert (public) ad_html_text_convert->template::head::add_css cookieconsent::add_to_page cookieconsent::add_to_page (public) cookieconsent::add_to_page->template::head::add_css

Testcases:
xowiki_test_cases
Source code:
    if {$alternate_p} {
        set rel "alternate stylesheet"
    } else {
        set rel "stylesheet"
    }

    template::head::add_link -rel $rel  -type text/css  -href $href  -media $media  -title $title  -lang $lang  -order $order  -crossorigin $crossorigin  -integrity $integrity
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: