I'm having issues getting the correct data with my Nested DOM. All works except that, so far, I've attached 3 photos to the first room, and it's returning those 3 photos for every Room. I figured that I needed a filter by ID of some sort for the GetRoomPhotos(), but nothing I tried worked.
My RoomsPage lists multiple Rooms (DOM). Each Room has it's own RoomPhoto gallery (Image DOM).
class RoomsPage_Controller extends Page_Controller {
function GetRooms() {
return DataObject::get('Room');
}
function GetRoomPhotos() {
return DataObject::get('RoomPhoto');
}
}
In the Template (RoomsPage.ss)
<% control GetRooms %>
...
<% control Top.GetRoomPhotos %>...<% end_control %>
<% end_control %>
Here's the full source from the 3 PHP pages if it helps... http://pastie.textmate.org/private/a8scxavuf4v8puuc5wfs5w
Thank you