Resolving Theme URLs

From Documentation
Revision as of 17:56, 7 April 2013 by Neillee2 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Themes comprises of stylesheets and images. The URLs for those resources must be resolved once the theme changes.

Several APIs were available to redirect theme resources to the correct location.

ServletFns.encodeThemeURL(String) is for translating image locations inside *.css.dsp files.

ServletFns.resolveThemeURL(String) is for redirecting the retrieval of stylesheets inside a ThemeProvider.

Example Usage (inside *.css.dsp)

tr.z-row-over > td.z-row-inner, tr.z-row-over > .z-cell {
    background-image: url(${c:encodeThemeURL('~./zul/img/grid/column-over.png')});

Example Usage (inside a ThemeProvider):

public String beforeWidgetCSS(Execution exec, String uri) {
	if (uri.startsWith("~./zul/css/") ||
		uri.startsWith("~./js/zul/")) {
		uri = ServletFns.resolveThemeURL(uri);
	return uri;

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.