Skip to content

Twig Template generator #10

@TheCadien

Description

@TheCadien

I think when we create templates, we should not only create the XML and an empty Twig template, but integrate a sample HTML directly into the Twig template.
To do this, we should set a default template for each content type, which is only used in the template.

Examples can be taken one-to-one from the documentation.

Example:

If you select ‘single_media_selection’ as the content type.
The command then writes to the XML.

<property name="document" type="single_media_selection">
    <meta>
        <title lang="en">Document</title>
    </meta>
</property>

and adds the following to the twig template.

{% set image = content.image %}
<img src="{{ image.thumbnails['400x400'] }}" alt="{{ image.title }}" title="{{ image.description|default(image.title) }}">

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions