What the 'config' influences in terms of the output of the grid editor depends on the implementation in the view.
Your config for your custom editor is using the 'media' view
if you have a look in your solution in the folder
/views/partials/grid/editors
you'll find a file called media.cshtml
and this is where your config is sent, along with the content for the editor to produce the output, and it's here the width and height parameters are being appended.
So you could copy this file, if your implementation is specific to your new editor (eg you don't want to change all media grid editors!) keep it in the same folder, call it
LoganMedia.cshtml
or similar, then in your config you can set the View to be LoganMedia
Then in LoganMedia, you can output the html for the media as you prefer based on any config values and the content entered by the editor...
Custom Media Grid Editor - Styles
Morning,
I've recently started using Grid layouts on our Umbraco site.
I've created quite a few custom editors so far, mainly textstrings, and I've been able to apply inline styles to those where needed.
I'm now trying to create a custom Media editor...
I've followed - https://our.umbraco.com/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Grid-Layout/Grid-Editors
but this appends the height and width to the url -
And i've also tried adding to "style" or "markup" within config -
but none of these are adding the styles inline, to my editor.
What am I missing?
Thanks for reading, any help is much appreciated.
Hi George
What the 'config' influences in terms of the output of the grid editor depends on the implementation in the view.
Your config for your custom editor is using the 'media' view
if you have a look in your solution in the folder
/views/partials/grid/editors
you'll find a file called media.cshtml
and this is where your config is sent, along with the content for the editor to produce the output, and it's here the width and height parameters are being appended.
So you could copy this file, if your implementation is specific to your new editor (eg you don't want to change all media grid editors!) keep it in the same folder, call it
LoganMedia.cshtml
or similar, then in your config you can set the View to be LoganMedia
Then in LoganMedia, you can output the html for the media as you prefer based on any config values and the content entered by the editor...
regards
Marc
Hi Marc,
Apologies for the delay in response, I've been on leave and only back this week.
Haven't yet had a chance to implement this in full, but based on your answer I now have a full understanding of what is required.
Thanks for taking the time to respond.
George
is working on a reply...