-
Notifications
You must be signed in to change notification settings - Fork 33
Getting Started
A content type defines a layout and/or a type of entry. For example if you want half of your pages to be 1 column and the other half to be 2 column you would then create 2 content types. Since the default install of CMS Canvas comes with a content type titled "Page" that is a single column layout, we will give an example of creating a 2 column layout.
-
Go to the admin panel (http://example.com/sitemin) and login. Then go to Tools => Content Types.
-
Click on the "Add Content Type" button.
-
Enter a title for your new content type. ex. "Double Column Page". This should also auto fill the "Short Name" field with "double_column_page".
-
Since this content type is going to be mostly text content we will want to "Enable Versioning" which will store revisions of the content for each entry created with this content type.
-
The other default settings for this content type are fine so now click the "Create" button at the top right.
Now that you have your new content type, you will need to define some fields. Fields are used to define the type of content that is to be displayed in the content type's markup.
-
Click on the "Fields" link in the navigation just below the breadcrumbs.
-
Click on the "Add Field" button.
-
Because this is just a simple text content page, select "Ckeditor" as the field type. Ckeditor is a nice clean 3rd party editor for inputting content in a website.
-
Give the the field a name in the "Field Label". ex. "Left Column". This should also auto fill the "Short Tag" field with "content"
-
The other default settings are fine. Now click the "Save" button at the top right.
-
Repeate steps 7-9 and create a "Right Column" field.
-
Now go back to your new content type by clicking "Edit Content Type" in the navigation just below the breadcrumbs.
-
In the "Markup" tab we need to write a little bit of html and specify where and how the content is to be displayed by referencing the fields by their short tag name.
<h1>{{ title }}</h1>
<div id="left_column">{{ left_column }}</div>
<div id="right_column">{{ right_column }}</div>
In the example above, this will output the page's title as a Heading 1 and then just below show a 2 column layout with the right and letf column content.
Entries are where you input all of the content for your website. An entry can be a page that is accessible from a browser via a URL or it can just be a chunk of content that is embedded in other pages and content types which is handy for building lists.
To build a new page using the new 2 column layout described above under Content Types:
-
Go to the admin panel (http://example.com/sitemin) and login. Then go to Content => Entries.
-
Click the "Add Entry" button which will show a dropdown with a list of content types.
-
Click on the "Double Column Page" content type.
-
You will now see a "Title", "Left Column", and "Right Column" field which you added to the "Double Column Page" content type earlier.
-
Add some content to these fields and then click the "Save" button.
Currently your content is saved and you now have a new entry with the title you gave it, however, it is not accessible to the outside world.
-
To make your new entry a page that is accessible to the outside world, it needs to have a URL. Click on the "Page" tab.
-
In the "Route" field specify what you would like the URL to be for this page. ex. "my-double-column-page". Do not use spaces or special characters here as this will be the actual URL used by the browser to access your page.
-
By default CMS Canvas will auto generate a meta title for the page but you can override it by using the "Meta Title" field.
-
Now click the "Save" button.
-
You can now view your page by going to your entry's URL. ex. http://example.com/my-double-column-page