Skip to content

Theming

Cliff Ingham edited this page Sep 11, 2020 · 2 revisions

Theming

Starting in version 1.10 you can now override template and block files with your own, customized versions. This makes it easier to custom style the application, while preserving you customizations as you perform upgrades over time.

Basically, uReport will look for custom version of Blocks and Templates inside your SITE_HOME. It will use the SITE_HOME version instead of the APPLICATION_HOME version. So all you need to do, inside SITE_HOME, is recreate the directory structure to any file you wish to customize.

Some popular files to customize are:

  • templates/html/partials/banner.inc
  • templates/html/partials/footer.inc
  • blocks/html/loginForm.inc

But really, you can override any blocks and/or templates this way.

CSS

Your theme can provide a templates/html/partials/stylesheets.inc to point to whatever custom CSS you like. The default stylesheets.inc assumes the theme css is BASE_URI/THEME/css/screen.css.

Because the theme is in the data directory, it is not immediately web accessible. These days, I add an alias to the Apache config to point to the theme I want to use. This way, the theme customizations survive when replacing the application with a new version.

Alias /crm/COB "/srv/data/ureport/Themes/COB/public"
<Directory     "/srv/data/ureport/Themes/COB/public">
    Options FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>
Clone this wiki locally