Twig Tastics

📘

This is an article for advanced users of Frontastic.

❗️

Experimental

Using this method is done at your own risk.

Twig Tastics can be used as an alternative frontend to purely use Server Side Rendering (SSR) and optionally skip client side JavaScript entirely.

Usage

To make use of this you have to take 2 steps.

  1. To enable the TwigTasticsBundle, add the below bundle to the config/bundles.php in your project:
return [
    new Frontastic\Catwalk\TwigTasticBundle\FrontasticCatwalkTwigTasticBundle(),
];
  1. Manually overwrite the generic render template templates/render.html.twig to use the Twig rendering:
{% include '@Tastic/render.html.twig' with { node: node, page: page, data: data } %}

You can also remove all JavaScript from the src/js/index.js, except for the service worker and SCSS by including:

import { registerServiceWorker } from 'frontastic-common'

import '../scss/app.scss'

registerServiceWorker()