Hi guys,
I am trying to create a function that displays random projects (image and text) on my About page if there is a testimonial assigned (filled out in CMS) to that project. I have the correct code for other similar functions i.e pulling the project to homepage if item is checked (in CMS) so I`m nearly there with this one.
In Page.php
public function SelectedAbout() {
return DataObject::get("PortfolioPage", "FILTER REQUIRED HERE", "RAND()", null, "");
}
In PortfolioPage.php
class PortfolioPage extends Page {
static $db = array(
'Url' => 'Text',
'ProjectInfo' => 'HTMLText',
'DisplayHomepage' => 'Boolean',
'Testimonial' => 'HTMLText'
...
Your help is appreciated.
Cheers,
Dave