Reputation: 455
I'm trying to link an image to the page it belongs to from a control loop on a separate page.
I have a controller function which grabs all of a certain page type which can be used on other pages to show their content. I call those pages and loop their children and then the images on those children.
The image link should refer to the child page which has the images. Currently $Link will only show the link to the image itself and $Top.Link refers to the current page not the page that contains the images.
Is there something I can use in the template or do I need another function?
<% loop $MyPages(A) %>
<% loop $Children(B) %>
<% loop $MyImages(C) %>
<a href="$LinkToChildPage(B)"><img src="$URL"></a>
<% end_loop %>
<% end_loop %>
<% end_loop %>
Upvotes: 2
Views: 442