dijkr / Copia

Laravel-project with CMS
0 stars 0 forks source link

Do not display, unless the item is published #32

Closed dijkr closed 1 year ago

dijkr commented 1 year ago

The view could try to display elements, but does not have data.

dijkr commented 1 year ago

The solution is to use the {{ if published }} tag within the collection:

    {{ collection:home }}
        {{ if published }}
            <div class="aanbiedingsactie">
    {{#         <div class="aanbiedingsactie-item"> #}}
                <img src="{{ banner_pm }}"/>
                <div class="text-overlay-actie">
                    <h2> {{ title }}</h2>
                    <h3> {{ subtitle }}</h3>
                    <a href="/aanbiedingen">Aanbiedingen</a>
    {{#             </div> #}}
                </div>
            </div>
        {{ else }}
                <p><h3>Binnenkort volgen er weer nieuwe acties!</h3></p>
        {{ /if }}
    {{ /collection:home }}