-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested CatalogPages #22
Comments
Hey @thezenmonkey |
I worked through something like this a while back on frankmullenger/silverstripe-gallery It required adding the ParentID to the constructor Pull Request. I don't know enough about GridField currently, and I swamped trying to get that site to launch. I can launch without, and circle back after and try and help tackle it. The basic version of it is: I can post my (ugly) code if it will help. |
Please post your ugly code - we can try get it working. We've added the ParentID in the model constructor previously by overloading the GridField instantiation like the below: $gridField = GridField::create(
'Artwork',
'Artwork Page',
Artwork::get()->filter('ParentID', $this->ID),
$gridFieldConfig = CatalogDataObjectGridFieldDetailForm::create()
);
$gridFieldConfig->setItemRequestClass('CatalogPageGridFieldDetailForm_ItemRequest');
if ($this->exists()) {
$model = new Artwork();
$model->ParentID = $this->ID;
$gridFieldConfig->setFields($model->getCMSFields());
} Then on $fields->addFieldsToTab("Root.Main", new HiddenField("ParentID", "ParentID",$this->ParentID), "Content"); |
@thezenmonkey are you still having issues with this? |
Sorry for the silance. I abandonded that implementation and changed the child object t DataObject instead of a Page |
@thezenmonkey thats okay :) I think this is still an issue which needs to be solved so will leave this one open |
I have the following two catalog pages
I'd love to give the client the ability to add/modify Artwork from it's own CatalogPageAdmin or from a Gridfield on Artist. However, when I add CatalogPageGridFieldDetailForm to either a RecordEditor or RelationEditor on Artist it always saves the Artwork to the first Artist and boots me back to teh ArtistAdmin when publishing the Artwork
The text was updated successfully, but these errors were encountered: