2
votes

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 %>
1

1 Answers

3
votes

Ok turns out you can use $Up.Up.Link