Hi I have a number of custom grid editors that I use on my Grid Content pages, these are not supported it seems out of the box with the translation manager.
I have found some links and documentation on supporting custom grid editors but its not entirely clear.
In the translations section of the translations.config I am configuring the following:
now my custom grid editors alias is listModule, all this module does is allow an editor to create an un-ordered list with each list item having a title and sub title. So the module stores an array of title and subtitles and loops them out in the view in the markup template below
Custom Grid Editor Translation Manager
Hi I have a number of custom grid editors that I use on my Grid Content pages, these are not supported it seems out of the box with the translation manager.
I have found some links and documentation on supporting custom grid editors but its not entirely clear.
In the translations section of the translations.config I am configuring the following:
now my custom grid editors alias is listModule, all this module does is allow an editor to create an un-ordered list with each list item having a title and sub title. So the module stores an array of title and subtitles and loops them out in the view in the markup template below
the module outputs the following markup:
Any ideas on how I would allow this modules list items to be brought into the translation screens?
Hi David,
translation manager is really just concerned with how the JSON is stored for your property.
So based on your config i would expect the JSON for the property to look something like.
but I suspect you're values are stored in an array?
so more like
the custom mapper that uses the config doesn't support arrays at the moment (not 100% sure the best way it could).
However, you can write your own mapper which would receive the JSON values from the grid and return the
TranslationValue
to Translation Manager.this is the code for the custom value mapper : https://gist.github.com/KevinJump/a7754bb20f93b1e9934a8cbfb1bb9203
Which is close to what you want (you wouldn't need to read things from config files and could work through the json in the format you know it is in)
Hi Kevin
Thanks for the reply, I have created a copy of the custom value mapper and hardcoded in the editor alias for a test example below.
I have set a breakpoint on the first line of GetSourceValue and GetTargetValue
but when debugging it is not hitting either of these methods.
My Manifest for the grid editor is the following:
Custom Value Mapper:
any ideas why this isnt hitting the breakpoint? I presume I am missing some configuration
Cheers
Hi David,
when you have a custom editor in code Translation Manager will append. Umbraco.Grid to the alias,
so, in this case, an Editor Alias of
Umbraco.Grid.listModule
should work.Kevin
Cheers Kevin, that worked perfectly
:)
is working on a reply...