New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Using multiple glide tags of the same field

Holger Lösken March 16, 2021 by Holger Lösken

I have this template snippet

{{ overview_images }}
    <div class="mx-auto">
        <a href="{{ glide:image }}" class="glightbox" data-gallery="gallery1">
        {{ glide:image width="135" height="135" }}
        <img class="rounded"
             src="{{ url }}"
             width="{{ width }}"
             height="{{ height }}"
             alt="{{ label }}"
             title="{{ label }}"

        <div class="mt-4 text-center w-full">
            {{ label }}
        {{ /glide:image }}
{{ /overview_images }}

First I just use the normal glide tag where I just need the url inside for the anchor, then followed by a glide tag pair. This does not seem, to work very well.

When I remove the a tag with the glide tag usage, the following images getting rendered without problems.
When I add the a tag again I just get an output of a URL.

I guess Antlers does not recognize that the first glide tag is followed by a pair.

Is there any notation so I can make it more clear?

Answered by Holger Lösken!
>>>>>>> Answered <<<<<<<
1 Reply
1 Follower