Skip to content

Commit e58911f

Browse files
authored
Apply suggestions from code review
1 parent 0889805 commit e58911f

File tree

2 files changed

+26
-26
lines changed
  • 16/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor
  • 17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor

2 files changed

+26
-26
lines changed

16/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-grid-editor.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,10 @@ In this example, we will be creating content programmatically for a "spot" Block
467467

468468
* A property called **featured** with the editor of **True/false**.
469469

470-
3. On a Document Type add a property called **blockGrid**.
471-
4. Then add as editor **Block Grid**.
472-
5. In the Block Grid add a new block and select the **Spot Element** element type.
473-
6. Then on the **Settings model** select the **Spot Settings** element type.
470+
3. Add a property called **blockGrid** in a Document Type.
471+
4. Select **Block Grid** as the property editor.
472+
5. Click **Add** in the **Blocks** Settings and select **Spot Element**.
473+
6. Select **Spot Settings** in the **Settings model** field.
474474

475475
![Block Grid - Block Configuration](../../../images/BlockEditorConfigurationProgramatically.png)
476476

@@ -611,7 +611,7 @@ For each item in the raw data, we need to create:
611611

612612
All `contentData` and `layoutData` entries need their own unique `Udi` as well as the ID (key) of their corresponding Element Types. In this sample, we only have one Element Type for content (`spotElement`) and one for settings (`spotSettings`). In a real life scenario, there could be any number of Element Type combinations.
613613

614-
7. First and foremost, we need models to transform the raw data into Block Grid compatible JSON. Create a class called **Model.cs** containing the following:
614+
7. Create a class called **Model.cs** containing the following to transform the raw data into Block Grid-compatible JSON:
615615

616616
{% code title="Models.cs" lineNumbers="true" %}
617617
```csharp
@@ -730,7 +730,7 @@ public class BlockGridLayoutItem
730730
```
731731
{% endcode %}
732732

733-
8. By injecting `IContentService` and `IContentTypeService` into an API controller, we can transform the raw data into Block Grid JSON. It can then be saved to the target content item. Create a class called **BlockGridTestController.cs** containing the following:
733+
8. Create a class called **BlockGridTestController.cs**. By injecting `IContentService` and `IContentTypeService` into an API controller, we can transform the raw data into Block Grid JSON. It can then be saved to the target content item.
734734

735735
{% code title="BlockGridTestController.cs" lineNumbers="true" %}
736736
```csharp
@@ -836,6 +836,6 @@ public class BlockGridTestController : Controller
836836

837837
For the above code `IContent? content = _contentService.GetById(Guid.Parse("efba7b97-91b6-4ddf-b2cc-eef89ff48c3b"));` change the id with your content node that is using the Block Grid.
838838

839-
10. In order to test this implementation, run the project and add send a `POST` request to `/umbraco/api/blockgridtest/create` after your domain name. If the result shows as **Saved** then check your content node and you will see the 2 spotElement contents.
839+
10. To test this implementation, run the project and send a `POST` request to `/umbraco/api/blockgridtest/create` after your domain name. If the result shows as **Saved**, then check your content node, and you will see the 2 spotElement contents.
840840

841841
![Block Grid - Result](../../../images/BlockEditorContentCreated.png)

17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-grid-editor.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This article is a work in progress and may undergo further revisions, updates, o
1616

1717
When testing out the property editor, you can use a set of predefined Blocks. The option will only be possible when there are no other Data Types using the Block Grid property editor.
1818

19-
<figure><img src="../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/Install-Sample-Configuration.png" alt=""><figcaption></figcaption></figure>
19+
<figure><img src="../../built-in-property-editors/block-editor/images/Install-Sample-Configuration.png" alt=""><figcaption></figcaption></figure>
2020

2121
* Create a new **Data Type**.
2222
* Select the **Block Grid** as the **Property editor**.
@@ -37,7 +37,7 @@ To set up the Block Grid property editor, follow these steps:
3737

3838
You will see the configuration options for a Block Grid property editor as shown below:
3939

40-
![Block Grid - Data Type Configuration](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/BlockGridEditor_Configuration.png)
40+
![Block Grid - Data Type Configuration](../../built-in-property-editors/block-editor/images/BlockGridEditor_Configuration.png)
4141

4242
The Data Type editor allows you to configure the following properties:
4343

@@ -55,7 +55,7 @@ Block Types are based on [**Element Types**](../../../../data/defining-content/d
5555

5656
Once you have added an Element Type as a Block Type on your Block Grid Data Type you have the option to configure it.
5757

58-
![Block Grid - Data Type Block Configuration](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/BlockGridEditor_DataType_Blocks.png)
58+
![Block Grid - Data Type Block Configuration](../../built-in-property-editors/block-editor/images/BlockGridEditor_DataType_Blocks.png)
5959

6060
### Groups
6161

@@ -126,11 +126,11 @@ To scale an Area, click and drag the scale-button in the bottom-right corner of
126126
* **Grid Columns for Areas** - Overwrites the amount of columns used for the Area grid.
127127
* **Areas** - Determines whether the Block can be created inside Areas of other Blocks.
128128

129-
![Block Grid - Areas](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/BlockGridEditor_Areas.png)
129+
![Block Grid - Areas](../../built-in-property-editors/block-editor/images/BlockGridEditor_Areas.png)
130130

131131
### Area configuration
132132

133-
![Block Grid - Area Configuration](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/BlockGridEditor_AreasConfiguration.png)
133+
![Block Grid - Area Configuration](../../built-in-property-editors/block-editor/images/BlockGridEditor_AreasConfiguration.png)
134134

135135
* **Alias** - The alias is used to identify this Area. It is being printed by `GetBlockGridHTML()` and used as name for the Area slot in Custom Views. The alias is also available for CSS Selectors to target the HTML-Element representing an Area.
136136
* **Create Button Label** - Overwrites the Create Button Label of the Area.
@@ -157,41 +157,41 @@ Notice that any styling of a Block is scoped. This means that the default backof
157157

158158
When viewing a **Block Grid** property editor in the **Content** section for the first time, you will be presented with the option to **Add content**.
159159

160-
![Block Grid - Add Content](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/BlockGridEditor_AddContent.png)
160+
![Block Grid - Add Content](../../built-in-property-editors/block-editor/images/BlockGridEditor_AddContent.png)
161161

162162
Clicking the **Add content** button opens up the **Block Catalogue**.
163163

164-
![Block Grid - Setup](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/BlockGridEditor_BlockPicker.png)
164+
![Block Grid - Setup](../../built-in-property-editors/block-editor/images/BlockGridEditor_BlockPicker.png)
165165

166166
The Block Catalogue looks different depending on the amount of available Blocks and their catalogue appearance.
167167

168-
![Block Grid - example setup](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/BlockGridEditor_BlockPicker_exsetup.png)
168+
![Block Grid - example setup](../../built-in-property-editors/block-editor/images/BlockGridEditor_BlockPicker_exsetup.png)
169169

170170
Click the Block Type you wish to create and a new Block will appear in the layout.
171171

172172
More Blocks can be added to the layout by clicking the Add content button. Alternatively, use the Add content button that appears on hover to add new Blocks between, besides, or above the existing Blocks.
173173

174-
![Block Grid - Add Content Inline](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/BlockGridEditor_AddContentInline.png)
174+
![Block Grid - Add Content Inline](../../built-in-property-editors/block-editor/images/BlockGridEditor_AddContentInline.png)
175175

176176
To delete a Block, click the trash icon which appears on the mouse hover.
177177

178-
![Block Grid - Delete Content](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/BlockGridEditor_DeleteContent.png)
178+
![Block Grid - Delete Content](../../built-in-property-editors/block-editor/images/BlockGridEditor_DeleteContent.png)
179179

180180
## Sorting Blocks
181181

182182
Blocks can be rearranged using the click and drag feature. Move them up or down to place them in the desired order.
183183

184184
Moving a Block from one Area to another is done in the same way. If a Block is not allowed in the given position, the area will display a red color and not allow the new position.
185185

186-
![Block Grid - Sorting Blocks](../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/Sorting_BlockGrid_Blocks.gif)
186+
![Block Grid - Sorting Blocks](../../built-in-property-editors/block-editor/images/Sorting_BlockGrid_Blocks.gif)
187187

188188
## Scaling Blocks
189189

190190
If a Block has multiple size options it can be scaled via the UI. This appears in the bottom left corner of the Block.
191191

192192
The Block is resized using a click-and-drag feature. Moving the mouse will change the size to the size options closest to the mouse pointer.
193193

194-
<figure><img src="../../../../../../../17/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/block-editor/images/resizing-block-block-grid.gif" alt=""><figcaption><p>Scale blocks in the grid by dragging from the bottom-right corner.</p></figcaption></figure>
194+
<figure><img src="../../built-in-property-editors/block-editor/images/resizing-block-block-grid.gif" alt=""><figcaption><p>Scale blocks in the grid by dragging from the bottom-right corner.</p></figcaption></figure>
195195

196196
## Rendering Block Grid Content
197197

@@ -467,10 +467,10 @@ In this example, we will be creating content programmatically for a "spot" Block
467467

468468
* A property called **featured** with the editor of **True/false**.
469469

470-
3. On a Document Type add a property called **blockGrid**.
471-
4. Then add as editor **Block Grid**.
472-
5. In the Block Grid add a new block and select the **Spot Element** element type.
473-
6. Then on the **Settings model** select the **Spot Settings** element type.
470+
3. Add a property called **blockGrid** in a Document Type.
471+
4. Select **Block Grid** as the property editor.
472+
5. Click **Add** in the **Blocks** Settings and select **Spot Element**.
473+
6. Select **Spot Settings** in the **Settings model** field.
474474

475475
![Block Grid - Block Configuration](../../../images/BlockEditorConfigurationProgramatically.png)
476476

@@ -611,7 +611,7 @@ For each item in the raw data, we need to create:
611611

612612
All `contentData` and `layoutData` entries need their own unique `Udi` as well as the ID (key) of their corresponding Element Types. In this sample, we only have one Element Type for content (`spotElement`) and one for settings (`spotSettings`). In a real life scenario, there could be any number of Element Type combinations.
613613

614-
7. First and foremost, we need models to transform the raw data into Block Grid compatible JSON. Create a class called **Model.cs** containing the following:
614+
7. Create a class called **Model.cs** containing the following to transform the raw data into Block Grid-compatible JSON:
615615

616616
{% code title="Models.cs" lineNumbers="true" %}
617617
```csharp
@@ -730,7 +730,7 @@ public class BlockGridLayoutItem
730730
```
731731
{% endcode %}
732732

733-
8. By injecting `IContentService` and `IContentTypeService` into an API controller, we can transform the raw data into Block Grid JSON. It can then be saved to the target content item. Create a class called **BlockGridTestController.cs** containing the following:
733+
8. Create a class called **BlockGridTestController.cs**. By injecting `IContentService` and `IContentTypeService` into an API controller, we can transform the raw data into Block Grid JSON. It can then be saved to the target content item.
734734

735735
{% code title="BlockGridTestController.cs" lineNumbers="true" %}
736736
```csharp
@@ -836,6 +836,6 @@ public class BlockGridTestController : Controller
836836

837837
For the above code `IContent? content = _contentService.GetById(Guid.Parse("efba7b97-91b6-4ddf-b2cc-eef89ff48c3b"));` change the id with your content node that is using the Block Grid.
838838

839-
10. In order to test this implementation, run the project and add send a `POST` request to `/umbraco/api/blockgridtest/create` after your domain name. If the result shows as **Saved** then check your content node and you will see the 2 spotElement contents.
839+
10. To test this implementation, run the project and send a `POST` request to `/umbraco/api/blockgridtest/create` after your domain name. If the result shows as **Saved**, then check your content node, and you will see the 2 spotElement contents.
840840

841841
![Block Grid - Result](../../../images/BlockEditorContentCreated.png)

0 commit comments

Comments
 (0)