Web Oriented Object Framework

User Guide (Version 0.5b4)

User Guide (Version 0.5b4)

Using stylesheets

Generating the URL for a stylesheet

You can generate the URL for a stylesheet with the url_for_stylesheet controller method. This will return a URL pointing to a stylesheet file. For example,

[my url_for_stylesheet _woof_ug.css]

will generate


The above example converts a stylesheet file name to a URL. The file is located as described in the Locating static resources chapter with public/stylesheets as the search root.

Alternatively, you can also pass in relative or absolute URLs (though the latter is only useful in the context of include_stylesheet described below). For example, a relative URL can be passed in as

[my url_for_stylesheet stylesheets/_woof/_woof_ug.css]

which will generate


Note that the relative URL is always assumed to be relative to the URL root for the Woof! application.

Generating a link for a stylesheet

Alternatively, you can generate the entire link for a stylesheet with the include_stylesheet controller method. Any additional attributes can also be passed to the command. For example,
[my include_stylesheet http://example.com/absolute/url/style.css]
[my include_stylesheet _woof.css]

will generate

<link href='http://example.com/absolute/url/style.css' rel='stylesheet' type='text/css'>
<link href='http://woof.sourceforge.net/woof-ug-0.5/stylesheets/_woof.css' rel='stylesheet' type='text/css'>


Stylesheets in the default layout

The default layout will automatically include links to stylesheets if the pagevar object contains the element stylesheets. See the Default page layout chapter for more details.