Search
Other Articles Anywhere questions
Forum

J!3 - How to call a dynamic layout in a articles loop

Nicolas OLIVIER's Avatar Nicolas OLIVIER
Hi,
In a article override we are trying to do this
<ul class="related__list">
    {articles category="current" limit="3" articles="!current"}
        <li>
            <?php echo JLayoutHelper::render('sepvret.content.card', $this->item); ?>
        </li>
    {/articles}
</ul>
We use AA in our templates files but we try to call a layout using the current article in the loop. The $this-item is obviously the issue ^^ Can we get the current objet you use in the loop ?

Thanks for your help
J!3.10.2
Peter van Westen's Avatar Peter van Westen ADMIN
No, you cannot do that in that way, as the PHP code is rendered before the {articles} tag is.

But you can use the [article] data tag and pass it a layout file.
See:
docs3.regularlabs.com/articlesanywhere/d...a#alternative-layout
Please post a rating at the Joomla! Extensions Directory
Nicolas OLIVIER's Avatar Nicolas OLIVIER
Your layou tag can use the override for html/layout/custom/custom.php ? Not anly articles layout ?
Peter van Westen's Avatar Peter van Westen ADMIN
Have you tried?
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription