Resources

No website would be complete without images, Javascript and CSS files. The LemonStand CMS engine provides you with a fully integrated resource manager that will allow you to quickly upload and create all the resource files you will need when creating the theme for your site. Any resources you add will be saved in a resources folder relative to the theme you are currently editing.

Let's go through the process of creating a CSS file to to be used with our Hello World! page under the Zest theme.

Log in to the backend of your store and click on the Store Design tab on the sidebar, then click on Resources:



Click on the CSS line item to access the CSS folder for the theme:


Click on the '+' button to add a new file. Let's name it example.css

Copy the following CSS rule to the Content area:

.lemon-yellow 
{
color:#ffcd24;
}
    

Your example.css editing page should now look like the following:

Click Save & Close to save our file. You will now see example.css in the list of files for the CSS directory.

Let's now open our Hello World! page and add the lemon-yellow class name to one of our elements. Click on the Pages menu item and then click into our Hello World! page.

Add our lemon-yellow class to the H1 element in the content area as follows:

<h1 class="lemon-yellow">Hello, World!</h1>
    

Click Save & Close to confirm our change.

We now need to include a reference to our example.css file in the HEAD element of our site. To do this open the Templates section under the Store Design menu and then click into test-template. Underneath the TITLE tag add the following code:

<link rel="stylesheet" type="text/css" href="{{ '/css/example.css' | theme_resource }}">
    

You will notice a filter in the HREF element of the LINK tag, denoted by |theme_resource. This filter tells LemonStand to output the path to your resource file relative to the theme that is active. In this case it would be the Zest theme. So, when LemonStand generates the file path on output, it would look like the following:

<link rel="stylesheet" type="text/css" href="https://d1ikx7rs2s8wko.cloudfront.net/store-warpedlino-54f40bc49c3b8/.../css/example.css?4845975">
    

Your content area should now look like this:

Hit Save & Close to confirm our changes, then navigate to the Hello World! page in your browser. As you can see our Hello, World! headline is now LemonStand yellow.