File Resolution
Overview
There are two different classes of files inside the theme module: files that are theme dependent but static (like images), and files that utilize theme variables and potentially need additional processing (JS and CSS).
The Theme module introduces new Spring ResourceResolvers
to do this work.
ThemeFileURLPathResolver
and ThemeFileResourceResolver
are added to the normal JavaScript and CSS ResourceResovler lists. These resolvers are automatically added to the out of box ResourceResolver lists.
ThemeFileURLPathResolver
ensures that static resources that are influenced by themes have a unique name. The component also ensures that if the resource is changed via the Broadleaf admin that pages will link to the new path.
ThemeFileResourceResolver
is responsible for finding the resource either in the database or within a Theme specific directory on the disk. This resolver also is responsible for replacing tokens if needed in the CSS and JS files if the files depend on ThemeConfiguration
variables.
See Also: Template Resolution