Skip to content
diyphpdeveloper edited this page Apr 12, 2019 · 1 revision

CREATING A CONTENT TYPE

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.

  1. Go to the admin panel (http://example.com/sitemin) and login. Then go to Tools => Content Types.

  2. Click on the "Add Content Type" button.

  3. 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".

  4. 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.

  5. 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.

  1. Click on the "Fields" link in the navigation just below the breadcrumbs.

  2. Click on the "Add Field" button.

  3. 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.

  4. Give the the field a name in the "Field Label". ex. "Left Column". This should also auto fill the "Short Tag" field with "content"

  5. The other default settings are fine. Now click the "Save" button at the top right.

  6. Repeate steps 7-9 and create a "Right Column" field.

  7. Now go back to your new content type by clicking "Edit Content Type" in the navigation just below the breadcrumbs.

  8. 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.

CREATING A ENTRY

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:

  1. Go to the admin panel (http://example.com/sitemin) and login. Then go to Content => Entries.

  2. Click the "Add Entry" button which will show a dropdown with a list of content types.

  3. Click on the "Double Column Page" content type.

  4. You will now see a "Title", "Left Column", and "Right Column" field which you added to the "Double Column Page" content type earlier.

  5. 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.

  1. 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.

  2. 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.

  3. By default CMS Canvas will auto generate a meta title for the page but you can override it by using the "Meta Title" field.

  4. Now click the "Save" button.

  5. You can now view your page by going to your entry's URL. ex. http://example.com/my-double-column-page

Clone this wiki locally