Creating CSS, Javascript and other assets

Stylesheets, javascript files or any other kind of text file can be added to your system by creating them first on your computer and uploading them in the file manager, or creating an editable stylesheet in the page manager.

We're going to assume you already uploaded the stylesheets that you do not wish to change to the file manager, and now wish to create a custom stylesheet that you will change from time to time.

This is the greatest benefit of the CMS. You can, in your browser, edit these files at any time.

Start by entering the admin area and going to Content > Design

Then you need to click on "New Page". You'll see the popup directing you to create a new page.

#1 Select your page type. Select the "Text, HTML, CSS, Javascript" option.

#2 Name your file. Choose a pathname for your stylesheet and any number of "virtual" directories. Don't forget to add the ".css" extension.

#3 Name your page. Use any name that you wish.

Once you've done those three steps, your page will be edited and you are free to add any kind of content in it.

You can link these pages to your HTML pages in the usual manner, example:

<link href="/css/application.css" rel="stylesheet">

or

<script src="/js/application.js" type="text/javascript">

Just remember to use the full pathname of the file you just created. Do not use relative pathnames like "css/application.css" (without the leading slash).

That's it. You are ready to use these assets in your layouts.

Last updated 2 months ago