hmm it doesnt work or i'm doing something wrong
so
this is my Obiekty.php DataObjectManager
class Obiekty extends DataObject {
static $db = array (
);
static $has_one = array (
'TrasyPage' => 'TrasyPage',
'ObiektyPage' => 'SiteTree'
);
public function getCMSFields_forPopup() {
return new FieldSet(
new SimpleTreeDropdownField('ObiektyPageID','Wybierz obiekt:')
);
}
}
TrasyPage.php
<?php
class TrasyPage extends Strona {
static $db = array(
'Lat' => 'Text',
'Lng' => 'Text',
'Rodzaj' => 'Varchar(50)',
'Trudnosc' => 'Enum("0,1,2,3,4,5","0")',
'Dlugosc' => 'Varchar(5)',
'Czas' => 'Float'
);
static $has_one = array(
);
static $has_many = array (
'NowyObiekt' => 'Obiekty'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$obiekty = new DataObjectManager(
$this,
'NowyObiekt',
'Obiekty',
array(
(what i have to put here when there is no field in db array in the Obiekty ?)
),
'getCMSFields_forPopup'
);
$fields->addFieldToTab("Root.Content.Obiekty", $obiekty);
(.....)
return $fields;
}
}
class TrasyPage_Controller extends Strona_Controller {
(.....)
}
?>
and ObiektyPage.php
class ObiektyPage extends Strona {
static $db = array(
'Zajawka' => 'Text',
'Lat' => 'Varchar(50)',
'Lng' => 'Varchar(50)'
);
static $has_one = array(
'Zdjecie' => 'Image'
);
static $has_many = array(
'Galeria' => 'Galeria'
);
function getCMSFields() {
(.....)
}
}
class ObiektyPage_Controller extends Strona_Controller {
}
and in template TrasyPage.ss i put what you said
$ObiektyPage.Title
or
<% control ObiektyPage %>
$Title
<% end_control %>
but i get nothing