Basic implementation that changes the Blocks formwidget to extend MLR… #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Basic implementation that changes the Blocks formwidget to extend MLRepeater and customizes the getLocaleSaveData to add the _group and _config to the save data. Also changes all blocks to use the Translate version (ml*).
This should be used alongside my PR for the wintercms/wn-translate-plugin's wip-ml-repeater-fields draft PR branch, at least until it gets merged into the draft PR branch.
This implementation is basic and very very rough around the edges, but is a working proof of concept.
This POC forces users to use Translate. Ideally, there should be an easier way to override the
getLocaleSaveData
and extend theMLRepeater
without forcing its use. A potential idea could be to just have an MLBlocks formwidget alongside the Blocks formwidget and add blocks that implement the ML versions.I'm not a fan of using the formWidgets'
data
key as it is deprecated and should only be for backwards compatibility, but I did not find a simpler way for now.The best implementation IMO would be to be able to add a
translatable
property to block fields which would make them use the ML version of their formwidget. I am not sure how thetranslatable
property implementation in thewip-ml-repeater-fields
branch is going, however.I will gladly take any ideas or suggestions to improve this!