Page Preview

Preview your pages before save. Markup, code, AJAX, components and responsiveness check support.

Back to Page Preview Support

Harti
Harti

Screenshot: https://imgur.com/fearK0O

Bug: The more "variables" I define/use in my template, the more page preview buttons appear.

Expected behavior: Only one appears, regardless of what I do in my template.

Reproduce: My layout file looks like this:

description = "Default layout"

[staticPage]

[staticMenu header]
code = "main"
==
<!DOCTYPE html>
<html>
    {% partial 'layout/head' %}
    <body class="no-js" data-header-collapsed>
        {% component 'header' %}

        {variable name="hero" label="Background Image" tab="Hero Banner" type="mediafinder" mode="image"}{/variable}

        <div id="page">
            <section id="hero" style="background-image:url({{ hero|media }});">
                <div class="grid-container">
                    <div class="grid-x align-bottom">
                        <div class="cell">
                            {repeater name="teaser" prompt="Add another teaser line" tab="Hero Banner"}
                                {variable name="teaser_line" label="Teaser Line" placeholder="**bold**, *italic*"}{/variable}
                            {/repeater}
                            {% for line in teaser %}
                                <div class="line">{{ line.teaser_line|md }}</div>
                            {% endfor %}
                        </div>
                    </div>
                </div>
            </section>
            <div id="content">
                {repeater name="section" prompt="Add another section" tab="Sections"}
                    <section style='background-image:url({mediafinder name="background" label="Background Image"}{/mediafinder});'>
                        <div class="grid-container">
                            <h2>
                                {text name="header" label="Headline"}{/text}
                                <span class="green">{text name="subheader" label="Sub-Headline"}{/text}</span>
                            </h2>
                            {richeditor name="section" label="Content"}{/richeditor}
                        </div>
                    </section>
                {/repeater}
                {% page %}
            </div>
        </div>
        {% partial 'layout/footer' %}
        {% partial 'layout/scripts' %}
    </body>
</html>

Thanks in advance! :)

Harti

Last updated

frozendo
frozendo

Hello,

Thank you for the bug report. The bug is fixed in the new version of Page Preview.

1-2 of 2