-
Notifications
You must be signed in to change notification settings - Fork 3
Basic Usage
marcjeanson edited this page Jan 27, 2012
·
9 revisions
Creating a basic page.
- Navigate to the /cms path in your browser
- Create a new page. This first page will be our layout file. Use the {{ content_for_layout }} variable for the spot that inner content will be inserted.
- Create a second page called home_page. This page will contain some basic content.
- Select the first page we created as the layout file for this page. To make the page publicly viewable, select the publish checkbox and since this will be our home page (makes the site accessible at the / path) also check the home page link.
- Clicking on the magnifying glass beside home_page will render the page at it’s public url. You can see the page at the /home_page url.
- Since we checked the home page checkbox when creating this page, we can also view the page at the / (root) url.
- We’ll upload an image now.
- It can be seen in the asset list on the left.
- Editing the home_page page, we insert some liquid markup using two built-in filters… asset_url and image_tag. This markup will insert our image asset into the page.
- Re-viewing the page, we can see our image renders within the page.
We didn’t demo components here, but they simply allow you to upload a collection of files as one zipped component that you may want to use in your website.
For example, you may want to use a jQuery plugin that is made up of various scripts, styles and images. Instead of going through the painful process of uploading each file separately as an asset, you can upload a single zip file and then reference each file using the component_url liquid tag (see the cms liquid docs from within the app for more details).