Hey,
Okay, simple question, hopefully simple answer :P
I want to show the URL of my sitetree variable IN the dataobjectmanager, much like the name and description...
However, even if I use 'HomeItemLink.Link' => 'Link' it won't show.
I was wondering if any of you have a solution to this, it's probably something simple that I'm not getting >_<
Example of my HomeItem object code:
<?php
class HomeItem extends DataObject {
static $db = array(
'HomeItemTitle' => 'Text',
'HomeItemDesc'=> 'Text'
);
public static $has_one = array(
'HomeItemImg' => 'Image',
'HomeItem' => 'Homepage',
'HomeitemLink' => 'SiteTree'
);
public function getCMSFields_forPopup() {
return new FieldSet(
new TextField('HomeItemTitle'),
new TextareaField('HomeItemDesc'),
new SimpleTreeDropdownField('HomeitemLinkID', 'Choose a page to show on the right:', 'SiteTree'),
new SimpleImageField('HomeItemImg')
);
}
}
Example of my Page.php code:
$manager = new DataObjectManager(
$this, // Controller
'HomeItems', // Source name
'HomeItem', // Source class
array(
'HomeItemTitle' => 'Name',
'HomeItemDesc' => 'Desc',
'HomeItemLink.Link' => 'Link'
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);