Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twig Template generator #10

Open
38 tasks
TheCadien opened this issue Dec 17, 2024 · 0 comments
Open
38 tasks

Twig Template generator #10

TheCadien opened this issue Dec 17, 2024 · 0 comments

Comments

@TheCadien
Copy link
Member

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) }}">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant