I have a collection of images within a custom page class, that represents a project and its associated images.
For the front page - I would like to show the first image from each project within a slider. The only issue I have is how to get to the images!
I started with this code in the controller :
public function ProjectPageList($limit=6){
$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
$list = DataObject::get("ProjectPage", "", "Created DESC","","$start , $limit");
return $list;
}
And then in the view:
<% loop ProjectPageList %>
<li>
<a href="$Link">
<% control getGalleryImages(1) %>
<img src="$Image" alt="$Title" />
<% end_control %>
</a>
<a class="inspiration" href="/your-inspiration/"><div>See more inspiration</div></a>
<a class="viewkitchen" href="$Link"><div>View this kitchen</div></a>
</li>
<% end_loop %>
A shove in the right direction would be appreciated!