Hi, I have a homepage class that displays the 10 most recently updated pages on the website. The problem is, that this includes pages that are not publicly visible. The code is:
function RecentlyUpdated() {
$pages = DataObject::get("Page", "", "LastEdited DESC", "", 10);
$doSet = new DataObjectSet();
foreach($pages as $key => $data) {
$title = $data->Title;
$summary = $data->obj('Content')->FirstParagraph('html');;
$record = array(
'Link' => $data->Link(),
'Title' => $title,
'Date' => date('Y-m-d', strtotime($data->LastEdited)),
'Summary' => $summary
);
$doSet->push(new ArrayData($record));
}
return $doSet;
}
What should I set the DataObject::get()'s parameters to in order to obtain just the publicly visible pages. Actually, I'd like to filter out and Forum page too. I assume that I only need to change the filter string, but I have no idea what to set it to.
Hans