This is the documentation for LemonStand V1, which has been discontinued. You can learn more and upgrade your store here.

LemonStand Version 1 Has Been Discontinued

This documentation is for LemonStand Version 1. LemonStand is now offered as a cloud-based eCommerce platform.
You can try the new LemonStand and learn about upgrading here.

Enabling Theming

Theming is automatically enabled for all new LemonStand installations. For the backward compatibility, Theming is disabled in LemonStand installations created before the feature has been introduced. You can enable Theming in your existing LemonStand installation manually, but it may require fixing resource file references and copying files on the server manually. Before you enable Theming, please read the Themes article and pay special attention to the Theme file resources section.

Please note that once enabled, Theming cannot be disabled.

To enable Theming, please open System/Settings page and click the Enable Theming link:

The form will ask you to create a new theme. Update the theme name and code if you wish and click Apply. This will create a default theme in your LemonStand copy. The next step is moving resource files (images, CSS and JavaScript files, etc.) specific for the theme from /resources directory to the theme resources directory (/themes/theme-code/resources). The /themes/theme-code/resources directory was automatically created on the first step. You should move the resource files manually.

As resource files have been moved, you should update references to them in pages, partials and layouts. Please use the theme_resource_url() function to resolve URLs to single files, and @ symbol to resolve URLs to files in the resource combiner calls. For example, you should replace "/resources/css/styles.css" reference in the css_combine() call with "@css/styles.css". Similarly, if you have a static image on a page, you should replace a static value (or root_url() call) in its src attribute with theme_resource_url() call:

<img src="<?= theme_resource_url('images/home-banner.png') ?>"/>

If you use file-based templates, the Theming enabling tool will create a subdirectory in your templates directory, with a name matching the new theme code, and copy the pages, layouts (templates) and partials directories into it. It will not delete the original directories, but they will not be used anymore. You can delete them when you make sure that transition to Theming worked properly.


Previous: Understanding Themes
Return to Understanding Themes