Skip to content
New issue

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

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

Already on GitHub? # to your account

Add possibility to generate placeholder image #9

Open
alexander-schranz opened this issue Jul 5, 2018 · 0 comments
Open

Add possibility to generate placeholder image #9

alexander-schranz opened this issue Jul 5, 2018 · 0 comments
Labels

Comments

@alexander-schranz
Copy link
Member

alexander-schranz commented Jul 5, 2018

Current:

        {% set headerImage = content.headerImages[0]|default %}
        {% if not headerImage %}
            {% set headerImage = {
                title: 'Placeholder',
                description: '',
                thumbnails: {
                    '1190x630': '/bundles/app/images/placeholder/1190x630.svg',
                    '490x575': '/bundles/app/images/placeholder/490x575.svg',
                    '690x420': '/bundles/app/images/placeholder/690x420.svg',
                }
            } %}
        {% endif %}

        {{ get_image(headerImage, '1190x630', {
            '(max-width: 575px)': '490x575',
            '(max-width: 991px)': '690x420',
        }) }}

Expected:

        {% set headerImage = content.headerImages[0]|default %}
        {% if not headerImage %}
            {% set headerImage = get_placeholder_image() %}
        {% endif %}

        {{ get_image(headerImage, '1190x630', {
            '(max-width: 575px)': '490x575',
            '(max-width: 991px)': '690x420',
        }) }}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant