Sylius CMS
  • Introduction
  • Getting started
    • Installation
    • Your first page
  • Concepts
    • Templates
    • Blocks
    • Views
    • Pages
    • Assets
  • Upgrade
    • Upgrade to v0.6
  • Support & feedback
    • Contact
    • Feedback
Powered by GitBook
On this page
  • Creating your first template
  • Creating your first block
  • Creating your first view
  • Creating your first page
  1. Getting started

Your first page

PreviousInstallationNextTemplates

Last updated 2 years ago

Creating your first page is a great start to getting to know the CMS capabilities. It will guide you through the process of creating templates, views, and blocks.

When a page is requested, the CMS will go through this flow:

  1. See if that page exists and is eligible to be shown

  2. Then render the view associated with the page

  3. The view in turn renders the blocks and the blocks are rendered in places determined by the template

Creating your first template

From this short description, you can deduce that the basis for our page is the template, so let's create a template. Click on Templates in the menu and click Create. Input first_template in the Code field and the following to the Source field:

{% block sscms_section_content %}
    Default content for this section
{% endblock %}

The internal description field is used for your internal usage to better identify templates later on. Here is a screenshot of what you should have now:

The prefix sscms_section_ is how you denote sections inside templates. Hence, we have just created a section inside our template named content.

Last, but not least, hit Create.

Creating your first block

Next up is creating the blocks we want to appear in the content section of the template. Go to Blocks and click Create. Input first_block in the Code field and add your content to the content fields. You should end up with something like this:

Hit Create.

Creating your first view

Now we have to tie the blocks to the section we defined in the template. We do this in a view. Click on Views and then Create.

Now, in the Code your input first_view and for the template you choose first_template. When you select the template the available sections for the template appears on the right. Now you select first_block and you should have something like the following image:

Remember to hit Create

Creating your first page

Last step! We will now create our page. Go to Pages and click Create. Input first_page in the Code field and select the view we just created, namely first_view, and input first-page in the Slug field. Again, here is an image showing what it could look like:

Click Create.

You're done! Go to /en_US/first-page to see your new page!

First template
First block
First block
First block