You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 15/umbraco-cms/tutorials/migrating-macros.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ The value holds JSON with:
155
155
- An alias to find the correct render/update logic.
156
156
- Two parameters with values entered by the user.
157
157
158
-
The first step in transforming the data is taking the JSON value and deserializing it into a `RichTextEditorValue`. This way we have a class to work with to store the updated data in.
158
+
The first step in transforming the data is taking the JSON value and deserializing it into a `RichTextEditorValue`. This way you have a class to work with to store the updated data in.
159
159
160
160
You can deserialize it yourself, or you can use the `RichTextPropertyEditorHelper` to do the job for you. It will also try to catch non-JSON values that have not been migrated to the new format.
161
161
@@ -225,9 +225,9 @@ Now that the relevant information has been extracted, it's time to decide what t
225
225
Note that:
226
226
227
227
- The markup still contains a tag placeholder but this time with only the `data-content-key`.
228
-
- That key references an item inside the blocks `contentData` that holds the values of the properties and a reference to the Element Type we setup earlier.
228
+
- That key references an item inside the blocks `contentData` that holds the values of the properties and a reference to the Element Type set up earlier.
229
229
- The same key is added to the `expose` collection and the Rich text `layout` collection.
230
-
- This means that if we have multiple blocks in the same value, more `contentData` items will be added in the blocks collection. They will be referenced in the `expose and `Layout accordingly.
230
+
- This means that if you have multiple blocks in the same value, more `contentData` items will be added in the blocks collection. They will be referenced in the `expose and `Layout accordingly.
231
231
232
232
The example below shows the full handling of an invariant macro to an invariant block.
233
233
@@ -342,7 +342,7 @@ public class CtaButtonMacroMigrator : IMacroMigrator
@@ -373,7 +373,7 @@ This example also only fetches the active (draft/current) version of the affecte
373
373
374
374
Once the data is transformed it needs to be stored. Custom SQL is used to perform this.
375
375
376
-
If you need to perform validation on the updated value, you either have to use a higher level services (`IContentValidationService`/`IContentEditingService`) or use the `RichTextPropertyValueEditor.Validate()` method. Because this example fetches the current data and overwrites it, the old value will not show up in the version history of the affected node. If you do need this to happen then we advise you to use the `IContentValidationService` or `IContentService` instead.
376
+
If you need to perform validation on the updated value, you either have to use a higher level services (`IContentValidationService`/`IContentEditingService`) or use the `RichTextPropertyValueEditor.Validate()` method. Because this example fetches the current data and overwrites it, the old value will not show up in the version history of the affected node. If you do need this to happen then it is advised to use the `IContentValidationService` or `IContentService` instead.
377
377
378
378
Now that you have a converter you need a way to call the correct one depending on the macros found in an RTE value. For this, create a `MacroMigrationService` that holds the following method:
379
379
@@ -598,7 +598,7 @@ public class CtaButtonMacroMigrator : IMacroMigrator
0 commit comments