Hi could you please give me some more help, I'm really new to this and haven't managed to get this to work.
I've created a new PageType = ContactPage.php in mysite/code
<?php
/**
* Defines the ContactPage page type
*/
class ContactPage extends Page {
static $db = array(
);
static $has_one = array(
);
}
class ContactPage_Controller extends Page_Controller {
public function ContactDetails() {
if(class_exists("ContactPage")) return DataObject::get_one("ContactPage");
}
}
function canCreate() {
if(DataObject::get_one('ContactPage')) {
return false;
} else {
return true;
}
}
?>
I'm not sure if this is correct?
This new PageType is then in the CMS (after Flush) and I've made a ContactPage with the details on.
Then called it in the the main template (Page.ss) like so:
<div id="content">
$Layout
$ContactDetails
</div>
I'm then expecting the ContactPage from the CMS to display its info at the bottom of every page..??
Help appreciated? Thanks