7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » DataObjects Overview Page + Column from a has_one
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 373 Views |
-
DataObjects Overview Page + Column from a has_one

5 July 2011 at 5:51am
hi,
I have this DO's:
Faq.php
class Faq extends DataObject {
...
static $has_one = array(
'FaqPage' => 'FaqPage',
'FaqGroup' => 'FaqGroup'
);FaqGroup.php
class FaqGroup extends DataObject {
static $db = array(
'groupname' => 'Varchar(255)'
);static $has_many = array(
'Faqs' => 'Faq'
...and this Page:
FaqPage.php
class FaqPage extends Page {
...
static $has_many = array(
'Faqs' => 'Faq'
);the DOM Code:
$f->addFieldToTab("Root.Content.FAQ", new DataObjectManager(
$this,
'Faqs',
'Faq',
array(
'question' => 'Frage',
'answer' => 'Antwort',
'active' => 'Aktiv?',
),
'getCMSFields_forPopup'
));As you see there are 3 columns for the overview. I need a 4th column with the FaqGroup (groupname), how to do that?
thx
-
Re: DataObjects Overview Page + Column from a has_one

5 July 2011 at 6:03am
FaqGroup.groupname doesn't work?
-
Re: DataObjects Overview Page + Column from a has_one

5 July 2011 at 6:11am Last edited: 5 July 2011 6:11am
...
$f->addFieldToTab("Root.Content.FAQ", new DataObjectManager(
$this,
'Faqs',
'Faq',
array(
'question' => 'Frage',
'answer' => 'Antwort',
'active' => 'Aktiv?',
'FaqGroup.groupname' => 'Gruppe'
),
'getCMSFields_forPopup'
));
...no, dont work for me - the column in the overvie is empty ...
-
Re: DataObjects Overview Page + Column from a has_one

5 July 2011 at 8:33am
sorry, it's working now - after re-saving the DO it's shows the groupname
| 373 Views | ||
|
Page:
1
|
Go to Top |

