Hi Guys,
Could someone perhaps give me a hand here,
I have a gallery of photos, each photo has a category, and a category has a category holder.
In the category holder, a selected image is used to represent each category, and is displayed on the category holder. I have this working fine like so:
public function CategoryPhotos() {
$categories = DataObject::get("PhotoCategory");
$primaryphotos = new DataObjectSet();
foreach($categories as $category){
$photo = DataObject::get_one("Photo", "ID=".$category->PrimaryPhotoID);
$primaryphotos->push($photo);
}
return $primaryphotos;
}
Basically, I want to also include the link and title of that category in the dataobjectset, so I can use it in the template, so the user can click through to the photo category.
Some help here would be grandly appreciated!
Thanks