Installing an OFBiz Visual Theme

OFBiz "Visual Themes" are like "skins" that allow for a consistent look and feel across all participating OFBiz Applications. A Visual Theme is a collection of files, usually packaged as an OFBiz Component that may include, among other things, FreeMarker templates for:

  • A top navigation bar
  • A secondary navigation bar
  • A HTML web page HEAD element called the "header"
  • An HTML web page footer section
  • Error messages web page insert

As well as all the CSS, images, and JavaScript necessary to customize the look and feel of one or more OFBiz web applications. Visual Themes provide a way to collect and organize most of the elements necessary to standardize website fonts, typefaces, menu behaviors, and web page presentation layout.

Themes are applied to theme-enabled web pages based on user preferences. A user may switch among available and installed themes at will by selecting the Visual Themes link on any out-of-the-box back-office application web page. Users must be logged in to change a theme.

Getting ready

You may either create your own Visual Theme as an OFBiz component in the themes directory, or download a theme from the OFBiz theme gallery located at:

http://cwiki.apache.org/confluence/x/5ABk

How to do it...

To change a theme, follow these steps:

  1. If you have downloaded a theme, unzip it into the themes Component directory. This creates a new Component with the same name as the theme.
  2. Stop OFBiz if it is running.
  3. From the OFBiz install directory, open a command line.
  4. Run the following command:
    ant run-install-seed
    
  5. Restart OFBiz.

Note

Note: the above instructions are taken from the official OFBiz Wiki page. Please be aware the ant run-install-seed command will rebuild your instance of OFBiz and reload all data marked as seed data, including the new Visual Theme data. If you have any seed data that has changed since the last time the ant run-install-seed—for example the default admin user's password—this data will be overwritten with data from unaltered seed data files.

How it works...

Packaging Visual Themes as Components is a convenience that allows for easy installation of new themes and retrieval of theme resources with a minimum amount of work. When you download a Visual Theme to your local OFBiz instance, you are preparing to install an OFBiz Component that includes the OFBiz artifacts necessary to apply a theme to one or more OFBiz web pages. These artifacts have been customized to deliver a unique visual web page presentation or "theme".

Running the ANT script from the OFBiz install directory installs a theme by loading the database with all the necessary information concerning the location of a theme's resources. Once in the database, theme resources are ready to be applied to web pages.

You may also install a theme's seed data directly into the database using the WebTools entity engine XML Import to DataSource form. If you load the seed data in this way, there is no need to stop and restart OFBiz.

There's more...

The default installed theme that comes with the download is configured in ~/framework/common/config/general.properties. In the absence of any other settings such as seed data loaded by an application, this is the theme that is applied until a user changes theme preferences.

Tip

Note: it is possible to have a Visual Theme that is not installed as an OFBiz Component. For example, the OFBiz e-commerce application implements a default theme, EC_DEFAULT, using only database values containing pointers to necessary theme resources. If you are curious about how this works, take a look at the following seed data file:

~/specialpurpose/ecommerce/data/EcommerceTypeData.xml

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.139.169