Install on a new Ibexa CMS project

Netgen provides an uptodate installation of Ibexa CMS with Netgen Layouts pre-installed. The installation is based on a clean Ibexa CMS install, ready to be used as a base for your new project.

This installation can later be used to upgrade to future versions of Ibexa CMS by following official Ibexa upgrade instructions.

Create a database

Create a database for your project with:

CREATE DATABASE my_project CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;

Use Composer

Install Composer and execute the following from a directory of your choice:

$ composer create-project netgen/layouts-ibexa-site my_project
$ cd my_project

Configure and install the database

Create a .env.local file in the project root directory to specify database connection details:

DATABASE_URL=mysql://user:pass@127.0.0.1/my_project

Run the following commands from the project root to install Ibexa CMS database together with Netgen Layouts database tables:

$ php bin/console ibexa:install
$ php bin/console doctrine:migrations:migrate --configuration=vendor/netgen/layouts-core/migrations/doctrine.yaml

Note

If you are using Doctrine Migrations for other parts of your app and generate a new migration with doctrine:migrations:diff console command, the generated migration will now include SQL commands that drop Netgen Layouts tables. To prevent this from happening, you can add the following config to your Doctrine configuration (if you already have schema_filter config, update it accordingly):

doctrine:
    dbal:
        schema_filter: ~^(?!nglayouts_)~

Rendering block items

To render block items, Netgen Layouts by default uses Ibexa CMS view type called standard. For every content object that you wish to include in a Netgen Layouts block, you need to define the standard view type, e.g.:

ibexa:
    system:
        site_group:
            content_view:
                standard:
                    article:
                        template: "@ibexadesign/content/standard/article.html.twig"
                        match:
                            Identifier\ContentType: article

Start the app

You can use the web server included with Symfony CLI to serve the app:

$ symfony server:ca:install # For HTTPS support, only needs to be ran once
$ symfony server:start

After that, open https://127.0.0.1:8000 in your browser to run the app.

What next?

Read up on how to achieve various developer tasks in Netgen Layouts by visiting the Cookbook docs section.