Install on a new eZ Platform project

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

This installation can later be used to upgrade to future versions of eZ Platform by following official eZ Systems 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 and specify the database connection info when asked:

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

Install the database

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

$ php bin/console ezplatform:install clean

# If you use Doctrine Migrations 3
$ php bin/console doctrine:migrations:migrate --configuration=vendor/netgen/layouts-core/migrations/doctrine.yaml

# If you use Doctrine Migrations 2
$ php bin/console doctrine:migrations:migrate --configuration=vendor/netgen/layouts-core/migrations/doctrine2.yaml

Rendering block items

To render block items, Netgen Layouts by default uses an eZ Platform 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.:

                        template: "@ezdesign/content/standard/article.html.twig"
                            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 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.