Im only new so please bare with me. I have been doing the lessons and am getting my head around this amazing cms framework.
However i would love to know if i can:
Add 3 tabs to the home page
And then add 2 tabs to the about page
And on each page the tab names and fields within the tabs to be different from the home page to the about page.
I can see you can create page types but is it possible to do what im asking.
Cheers
Jonnyboy
for example: ( Now i know the below dosent work, im just showing you what i want to do within the admin area of the pages app )
<?php
// i want this on about page
// if page=about {
class Page extends SiteTree {
private static $has_one = array (
'Intro' => 'image',
'Main' => 'image',
'Slide' => 'image',
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Images', $intro = UploadField::create('Intro'));
$fields->addFieldToTab('Root.Images', $main = UploadField::create('Main'));
$fields->addFieldToTab('Root.Images', $slide = UploadField::create('Slide'));
$intro->setFolderName('page-photos/intro');
$main->setFolderName('page-photos/main');
$slide->setFolderName('page-photos/slide');
return $fields;
}
// } elseif page=home {
class Page extends SiteTree {
private static $has_one = array (
'Slide' => 'image',
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Images', $slide = UploadField::create('Slide'));
$slide->setFolderName('page-photos/slide');
return $fields;
}
// }
}
class Page_Controller extends ContentController {
private static $allowed_actions = array ();
public function init() { parent::init(); }
}