Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine

Netgen Layouts: Building Pages with Symfony

1:15:54

What you'll be learning

// composer.json
{
    "require": {
        "php": ">=8.0.0",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "babdev/pagerfanta-bundle": "^3.7", // v3.7.0
        "doctrine/doctrine-bundle": "^2.7", // 2.7.0
        "doctrine/doctrine-migrations-bundle": "^3.2", // 3.2.2
        "doctrine/orm": "^2.13", // 2.13.3
        "easycorp/easyadmin-bundle": "^4.4", // v4.4.1
        "netgen/layouts-contentful": "^1.3", // 1.3.2
        "netgen/layouts-standard": "^1.3", // 1.3.1
        "pagerfanta/doctrine-orm-adapter": "^3.6",
        "sensio/framework-extra-bundle": "^6.2", // v6.2.8
        "stof/doctrine-extensions-bundle": "^1.7", // v1.7.0
        "symfony/console": "5.4.*", // v5.4.14
        "symfony/dotenv": "5.4.*", // v5.4.5
        "symfony/flex": "^1.17|^2", // v2.2.3
        "symfony/framework-bundle": "5.4.*", // v5.4.14
        "symfony/monolog-bundle": "^3.0", // v3.8.0
        "symfony/proxy-manager-bridge": "5.4.*", // v5.4.6
        "symfony/runtime": "5.4.*", // v5.4.11
        "symfony/security-bundle": "5.4.*", // v5.4.11
        "symfony/twig-bundle": "5.4.*", // v5.4.8
        "symfony/ux-live-component": "^2.x-dev", // 2.x-dev
        "symfony/ux-twig-component": "^2.x-dev", // 2.x-dev
        "symfony/validator": "5.4.*", // v5.4.14
        "symfony/webpack-encore-bundle": "^1.15", // v1.16.0
        "symfony/yaml": "5.4.*", // v5.4.14
        "twig/extra-bundle": "^2.12|^3.0", // v3.4.0
        "twig/twig": "^2.12|^3.0" // v3.4.3
    },
    "require-dev": {
        "doctrine/doctrine-fixtures-bundle": "^3.4", // 3.4.2
        "symfony/debug-bundle": "5.4.*", // v5.4.11
        "symfony/maker-bundle": "^1.47", // v1.47.0
        "symfony/stopwatch": "5.4.*", // v5.4.13
        "symfony/web-profiler-bundle": "5.4.*", // v5.4.14
        "zenstruck/foundry": "^1.22" // v1.22.1
    }
}

Netgen Layouts is about having your 🎂 - i.e. any Symfony app - and eating it too... by allowing you to rearrange your pages and mix in dynamic content via an admin area. Yup, your Symfony app & Twig templates + the power of a CMS tacked into the side. And all of this is done in a gently way, without "taking over" your app.

In this tutorial, we'll go from zero to hero by installing Layouts into an existing Symfony app:

  • Installing & Setting up Layouts
  • Mapping a "Layout" to existing pages
  • Including your existing Twig blocks in your layout
  • Adding custom "value types" and "query types" so you can embed grids/lists of the custom content from your app
  • Customizing "item views": the templates used in grids/lists
  • Creating a "content browser" to manually select content from your app
  • Pulling content from a CMS - Contentful for our example
  • Theming! Powerful and simple way to override templates
  • Block Views: customizing how a block renders
  • Block Plugins: adding custom options to every block in the system

Layouts is fun: adding a new level of flexibility without changing how you build your app.


Your Guides

Ryan Weaver


Join the Conversation?

4
Login or Register to join the conversation
Johann Avatar

Yes! this is awesome! But a little problematic for me. I started a project with Symfony 6.1 and would really like to use Netgen Layouts for this project. I've found a dev version (1.4.x-dev) but nothing about a stable release. Does anybody know about a stable release, compatible with Symfony 6.1 (or 6.2 which will be released very soon)?

Reply
Ivo Avatar

Hi Johann,

It is coming very soon :) We are finalizing the 1.4 version (which support Symfony 6) and will release it when its ready, should happen in about 2-3 weeks. We will announce it on our newsletter and on our slack, feel free to join the community!

1 Reply
Fabrice Avatar
Fabrice Avatar Fabrice | posted 1 month ago

Godness! I didn't know that! It looks really awesome! When do you plan to start this course?

Reply

Hey Fabrice,

We're actively working on it right now and plan to start releasing it in the middle of November, but it might be a bit delayed because we're also actively releasing 2 courses right now: Design Patterns and PHPUnit. November is a busy month with the SymfonyCon conference which might reflect our schedule. But we're want to release it this year ;)

Cheers!

1 Reply
Cat in space

"Houston: no signs of life"
Start the conversation!