-
Notifications
You must be signed in to change notification settings - Fork 78
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
Editing Image fields after upload #71
Comments
Usually the way you do this is by wrapping the file in a DataObject. class MyFileDataObject extends DataObject
{
private static $db = ['Caption' => 'Varchar'];
private static $has_one = ['File' => 'File'];
public function getCMSFields()
{
$fields = FieldList::create(TabSet::create('Root'));
$fields->addFieldsToTab('Root.Main', [
TextField::create('Caption'),
FileAttachmentField::create('File')
]);
return $fields;
} Then just manage these objects with a GridField. |
Indeed, but I'm using it through the frontend .. Currently I use some ajax after upload of the images to load some textfields in for each image.. Just seems pretty crappy. |
I'm working on a project that requires this feature. I have managed to get it working with a bit of work.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What would be the best way to give a user the ability to edit the Title field on Image, after it has been uploaded?
I've got a use case where users upload images in a form, and then be able to set a caption for each image. Then the form is submitted.
Not sure if this module out of the box can easily let me build such functionality.
The text was updated successfully, but these errors were encountered: