I have a page type, Boatpage.php
I'd like to create a form with a few dropdown lists, on my homepage for instance, that will populate their options from the Manufacturer and Model fields in existing pages. Here's an example
When the form is submitted I'd like to show a filtered list of the BoatPage's in my BoatHolder page type that meet the criteria selected in the dropdowns.
I've been reading through a lot of tutorials and documentation, and I'm a bit stuck. Could someone point me in the right direction.
Boatpage.php
<?php
class BoatPage extends Page {
static $db = array(
'Manufacturer' => 'Text',
'Model' => 'Text',
'Stockno' => 'Text',
'Length' => 'Text',
'Type' => 'Text',
'Dryweight' => 'Text',
'Options' => 'Text',
'Status' => 'Text',
'Price' => 'Text',
'Location' => 'Text',
'Year' => 'Text'
);
static $has_one = array(
'Photo' => 'Image'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new TextField('Manufacturer'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Model'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Stockno'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Length'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Type'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Dryweight'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Options'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Status'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Price'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Location'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Year'), 'Content');
$fields->addFieldToTab("Root.Images", new UploadField('Photo'));
return $fields;
}
}
class BoatPage_Controller extends Page_Controller {
}
?>
BoatHolder.php
<?php
class BoatHolder extends Page {
static $allowed_children = array('BoatPage');
}
class BoatHolder_Controller extends Page_Controller {
}
?>
(side note: I am a noob.)