Articles Anywhere

Articles Anywhere removes closing div after unpublished item

9 months 1 week ago #77843

Hans Kuijpers's Avatar Hans Kuijpers

I have the following piece of code in a Joomla article.

<div class="block-features">
    <div class="container">
        <div class="row">
            {article features-intro}
            <div class="col-xs-12">
                <hr/>
                <h2>{title}</h2>
            </div>
            {/article}
        </div>
        <div class="row block-special-features">
            <div class="col-md-6">
                {articles cat:ordering:features-items}
                <h3>{title}</h3>
                {text}
                {/articles}
            </div>
            <div class="col-md-6">
                {article features-unique-feature}
                <img src="{image_intro}" class="img-responsive" alt="{image_intro_alt}"/>
                {text}
                {/article}
                {article features-official-partner}
                <img src="{image_intro}" class="img-responsive" alt="{image_intro_alt}"/>
                {text}
                {/article}
            </div>
        </div>
    </div>
</div>


When article with alias = features-official-partner is not published a closing div is removed.
Instead of four closing divs I notice three closing divs.
This behaviour ruins the site.

Can you reproduce and solve this issue?

9 months 1 week ago #77845

Peter van Westen's Avatar Peter van Westen Admin

Try placing the {article} tags inside <p> tags:

<div class="block-features">
    <div class="container">
        <div class="row">
            <p>{article features-intro}</p>
            <div class="col-xs-12">
                <hr/>
                <h2>{title}</h2>
            </div>
            <p>{/article}</p>
        </div>
        <div class="row block-special-features">
            <div class="col-md-6">
                <p>{articles category="features-items"}</p>
                <h3>{title}</h3>
                {text}
                <p>{/articles}</p>
            </div>
            <div class="col-md-6">
                <p>{article features-unique-feature}</p>
                <img src="{image_intro}" class="img-responsive" alt="{image_intro_alt}"/>
                {text}
                <p>{/article}</p>
                <p>{article features-official-partner}</p>
                <img src="{image_intro}" class="img-responsive" alt="{image_intro_alt}"/>
                {text}
                <p>{/article}</p>
            </div>
        </div>
    </div>
</div>

9 months 6 days ago #77946

Hans Kuijpers's Avatar Hans Kuijpers

yuck... for real? That's ugly.

9 months 6 days ago #77948

Peter van Westen's Avatar Peter van Westen Admin

Articles Anywhere is designed to be used in your content editor.
You are pretty much using it as a replacement for php.