0

At first I had this particular problem where Assets' {url} tag was returning "http://", all the time for any file.

{page_gallery}
    <li><a href="{url}" class="gallery"><img src="{url}"></a></li>
{/page_gallery}

Resulting in:

<li><a href="http://" class="gallery"><img src="http://"></a></li>

After hours of debugging, I've found that it's because that part of the template is wrapped in a {exp:member:custom_profile_data} where {url}actually means the user's URL.

I identified the problem, fine, but there is no way I can remove {exp:member:custom_profile_data} in this template. Is there any other way to access Assets' {url}? Namespace it someway?

1

Another way would be to use the var_prefix parameter. {page_gallery var_prefix="image} {image:url} {/page_gallery}

And yet another would be just to use the Assets field as a single tag: {page_gallery}

1
  • That did it. Also was able to include image manipulations with {image:url:small}. Cheers! – Rémi Breton Apr 29 '13 at 13:48
2

Try the shortcut tag: {page_gallery:url}.

1
  • This outputted the right URL, but seemed to break my HTML after one iteration. – Rémi Breton Apr 29 '13 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.