我可以在管理页面中有 2 个网格域组件,其名称与同一个数据对象不同吗 - 例如
class MainLandingPage_au extends Page
{
private static $has_many = [
'ImagesWithHtml' => ImageWithHtml::class,
'ImagesWithHtml2' => ImageWithHtml::class,
];
// ...
$fields->addFieldToTab('Root.Section1', HtmlEditorField::create('Section1Title','Section 1 Title')->setRows(4));
$fields->addFieldToTab('Root.Section1', GridField::create(
'ImagesWithHtml',
'Images With Html For This Page',
$this->ImagesWithHtml(),
GridFieldConfig_RecordEditor::create()
));
$fields->addFieldToTab('Root.Section2', HtmlEditorField::create('Section2Title','Section 2 Title')->setRows(4));
$fields->addFieldToTab('Root.Section2', GridField::create(
'ImagesWithHtml2',
'Images With Html For Section 2',
$this->ImagesWithHtml2(),
GridFieldConfig_RecordEditor::create()
));