![]() In the meantime, on the content type "Manage Form Display" page, if you set your reusable image field to use "Entity Browser" you can see what it will be like when it's working fully. ![]() However, there is a UI being built for it which should be ready soon, so I decided to wait for that. I added a widget of type "Upload" and gave it a human readable name of "Add New Image" and added a widget of type "View" and gave it a human readable name of "Reuse Existing Image" (then chose the "test" files browser view as the view that I would use to find my files).Ī caveat - I couldn't get this to work with the Inline Entity Form (it's possible in code - see the "hook_inline_entity_form_reference_form_alter()" in "entity_browser_entity_form.module"). I left all the settings as default until I got to the last screen "widgets". In my case, I gave it a name of "Image Browser". Then, navigate to /admin/config/content/entity_browser and choose "Add entity browser". To make this a little easier, I also installed the Entity Browser sub-modules "Entity Browser Test Modules". This is because the Inline Entity Form is not yet using the "Entity Browser" module to search for your media. If you had chosen "Add existing media" from a few screenshots above, you will be given the same autocomplete interface that you saw earlier. "Add new media" will open up the form that is found at /media/add and let you add the media inline here.Īfter filling out this form, be sure to click on the "Create media" button. Now, when you are on your node edit page you will see an interface like this for your reusable image field: Find the reusable image field and change the widget from 'autocomplete' to 'Inline Entity Form - complex' (don't worry, it's not complex!).Ĭlick the settings cog on the right and set the inline entity form to be able to both add new media and use existing media: Next, go to the "Manage Form Display" page on your content type. Step 4 - Create New Media/Use Existing Media - inline Enter the wonderful Inline Entity Form module. Whilst this works, it doesn't allow us to add new images from here. Your node edit form will have a field like this: This means the image needs to have already been added to your site (at /media/add/) and that you know the name you gave to the image when adding it. You now have a field that allows you to reference uploaded images using the entity reference widget. In our case, we only have image at the moment. On the following page, scroll to the end and select the types of media bundles that can be referenced from this field. On the following page, choose the type of entity that this field will reference/use - in our case "Media". ![]() Choose field of type "Other" under "Reference" (yes, it could be a little more intuitive!). Navigate to the "Manage Fields" page of one of your content types and add a new field. Step 3 - Add a Media Field to a Content Type It's a similar process for creating other media types. Save the page, and then use the UI to add a new field to your image media bundle - at a minimum you will need an image field.Ĭlick the edit button to edit the image media bundle and check that the image field is now set as the field that the image will be sourced from. You will be asked to define a field to use as the image field, you can't do that yet as you have not created any fields. Navigate to /admin/structure/media and add a media bundle - for example "Image":
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |