Skip to content

Commit 5464dce

Browse files
Merge pull request #4698 from syncfusion-content/998697-updated-snippets
998697: Need to ensure the sample and contents of Blockeditor based on API refinements
2 parents 9948389 + 4a77e57 commit 5464dce

File tree

89 files changed

+989
-372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+989
-372
lines changed

ej2-asp-core-mvc/blockeditor/EJ2_ASP.MVC/appearance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ You can use the [CssClass](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusi
6262
{% endhighlight %}
6363
{% endtabs %}
6464

65-
![Appearance](images/appearance.png)
65+
![Appearance](./../images/appearance.png)

ej2-asp-core-mvc/blockeditor/EJ2_ASP.MVC/built-in-blocks/built-in-blocks.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ domainurl: ##DomainURL##
1111

1212
# Blocks in ##Platform_Name## Block Editor control
1313

14-
The Block Editor control enables you to create block-based content editing solution using various types of blocks. The [Blocks](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.Blocks.html) property allows you to define and manage the content structure of your editor.
14+
The Block Editor control enables you to create block-based content editing solution using various types of blocks. The [Blocks](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockEditor.html#Syncfusion_EJ2_BlockEditor_BlockEditor_Blocks) property allows you to define and manage the content structure of your editor.
1515

1616
## Blocks
1717

1818
Blocks are the fundamental building elements of the Block Editor. Each block represents a distinct content unit such as a `Paragraph`, `Heading`, `List`, or specialized content like `Code Snippets` or `Images`. The Block Editor organizes content as a collection of `blocks`, allowing for better structure and formatting options.
1919

20-
You can configure blocks with various properties such as `id`, `blockType`, `content` and more to create rich and structured editor.
20+
You can configure blocks with various properties such as `id`, [blockType](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html), `content` and more to create rich and structured editor.
2121

2222
## Block types
2323

@@ -53,11 +53,11 @@ By default, the `indent` property is set to `0`.
5353
{% endhighlight %}
5454
{% endtabs %}
5555

56-
![Block Indent](images/block-indent.png)
56+
![Block Indent](./../../images/block-indent.png)
5757

5858
## Configure CSS Class
5959

60-
You can apply custom styling to individual blocks using the `cssClass` property. This property accepts a string containing one or more CSS class names.
60+
You can apply custom styling to individual blocks using the [cssClass](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockEditor.html#Syncfusion_EJ2_BlockEditor_BlockEditor_CssClass) property. This property accepts a string containing one or more CSS class names.
6161

6262
Custom CSS classes allow you to define specialized styling for specific blocks in your editor.
6363

@@ -70,11 +70,11 @@ Custom CSS classes allow you to define specialized styling for specific blocks i
7070
{% endhighlight %}
7171
{% endtabs %}
7272

73-
![Block cssClass](images/block-cssClass.png)
73+
![Block cssClass](./../../images/block-cssClass.png)
7474

7575
## Configure templates
7676

77-
The Block Editor allows you to use custom templates for specialized content using the `template` property. Templates can be defined as strings, functions, or HTML elements.
77+
The Block Editor allows you to use custom templates for specialized content using the [template](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Template) property. Templates can be defined as strings, functions, or HTML elements.
7878

7979
{% tabs %}
8080
{% highlight razor tabtitle="CSHTML" %}
@@ -85,4 +85,4 @@ The Block Editor allows you to use custom templates for specialized content usin
8585
{% endhighlight %}
8686
{% endtabs %}
8787

88-
![Template Block](images/block-template.png)
88+
![Template Block](./../../images/block-template.png)

ej2-asp-core-mvc/blockeditor/EJ2_ASP.MVC/built-in-blocks/code-block.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ domainurl: ##DomainURL##
1111

1212
# Code Blocks in ##Platform_Name## Block Editor control
1313

14-
You can render Code blocks by setting the `blockType` property as `Code`. By setting the `properties` property, you can configure the default language. The default language is `plainText`.
14+
You can render Code blocks by setting the [blockType](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html) property as [Code](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Code). By setting the `properties` property, you can configure the default language. The default language is `plainText`.
1515

1616
## Global Code Settings
1717

18-
You can configure global settings for code blocks using the `CodeBlockSettings` property in the Block Editor root configuration. This ensures consistent behavior for syntax highlighting and language options across all code blocks.
18+
You can configure global settings for code blocks using the [CodeBlockSettings](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockEditor.html#Syncfusion_EJ2_BlockEditor_BlockEditor_CodeBlockSettings) property in the Block Editor root configuration. This ensures consistent behavior for syntax highlighting and language options across all code blocks.
1919

20-
The `CodeBlockSettings` property supports the following options:
20+
The [CodeBlockSettings](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockEditor.html#Syncfusion_EJ2_BlockEditor_BlockEditor_CodeBlockSettings) property supports the following options:
2121

2222
| Property | Description | Default Value |
2323
|----------|-------------|---------------|
24-
| [languages](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.CodeBlockSettingsModel.html#Syncfusion_EJ2_BlockEditor_CodeBlockSettingsModel_Languages) | Specifies the array of language options for syntax highlighting. | [] |
25-
| [defaultLanguage](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.CodeBlockSettingsModel.html#Syncfusion_EJ2_BlockEditor_CodeBlockSettingsModel_DefaultLanguage) | Defines the default language to use for syntax highlighting. | 'plaintext' |
24+
| `languages` | Specifies the array of language options for syntax highlighting. | [] |
25+
| `defaultLanguage`| Defines the default language to use for syntax highlighting. | 'plaintext' |
2626

2727
Each language object in the `languages` array should have:
2828
- `language`: The language value used for syntax highlighting
@@ -49,4 +49,4 @@ Below example illustrates how to render the different code block in the Block Ed
4949
{% endhighlight %}
5050
{% endtabs %}
5151

52-
![Code Block](images/block-code.png)
52+
![Code Block](./../../images/block-code.png)

ej2-asp-core-mvc/blockeditor/EJ2_ASP.MVC/built-in-blocks/embed.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ Block Editor supports addition of embeds to help you organize, showcase contents
1515

1616
## Image Block
1717

18-
You can use the `Image` block to showcase an image content within your editor.
18+
You can use the [Image](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Image) block to showcase an image content within your editor.
1919

2020
### Configure Image Block
2121

22-
You can render an `Image` block by setting the `blockType` property to `Image` in the block model. The `properties` property allows you to configure the image source, allowed file types, display dimensions, and more.
22+
You can render an [Image](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Image) block by setting the [blockType](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html) property to [Image](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Image) in the block model. The `properties` property allows you to configure the image source, allowed file types, display dimensions, and more.
2323

2424
#### Global Image Settings
2525

26-
You can configure global settings for image blocks using the `ImageBlockSettings` property in the Block Editor root configuration. This ensures consistent behavior for image uploads, resizing, and display.
26+
You can configure global settings for image blocks using the [ImageBlockSettings](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockEditor.html#Syncfusion_EJ2_BlockEditor_BlockEditor_ImageBlockSettings) property in the Block Editor root configuration. This ensures consistent behavior for image uploads, resizing, and display.
2727

28-
The `ImageBlockSettings` property supports the following options:
28+
The [ImageBlockSettings](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockEditor.html#Syncfusion_EJ2_BlockEditor_BlockEditor_ImageBlockSettings) property supports the following options:
2929

3030
| Property | Description | Default Value |
3131
|----------|-------------|---------------|
@@ -41,7 +41,7 @@ The `ImageBlockSettings` property supports the following options:
4141

4242
#### Configure Image Block Properties
4343

44-
The `Image` block `properties` property in the block model supports the following options:
44+
The [Image](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Image) block `properties` property in the block model supports the following options:
4545

4646
| Property | Description | Default Value |
4747
|----------|-------------|---------------|
@@ -50,6 +50,24 @@ The `Image` block `properties` property in the block model supports the followin
5050
| height | Specifies the display height of the image. | `''` |
5151
| altText | Specifies the alternative text to display when the image cannot be loaded. | `''` |
5252

53+
### BlockType & Properties
54+
55+
The following example demonstrates how to pre-configure an [Image](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Image) block in the editor.
56+
57+
```typescript
58+
// Adding image block
59+
{
60+
blockType = "Image",
61+
properties = new
62+
{
63+
src = "https://cdn.syncfusion.com/ej2/richtexteditor-resources/RTE-Overview.png",
64+
width = '200px',
65+
height = '100px',
66+
altText = '',
67+
}
68+
}
69+
```
70+
5371
The below sample demonstrates the configuration of image block in the Block Editor.
5472

5573
{% tabs %}
@@ -61,4 +79,4 @@ The below sample demonstrates the configuration of image block in the Block Edit
6179
{% endhighlight %}
6280
{% endtabs %}
6381

64-
![Image Block](images/block-image.png)
82+
![Image Block](./../../images/block-image.png)

ej2-asp-core-mvc/blockeditor/EJ2_ASP.MVC/built-in-blocks/inline-content.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ You can specify the type of content using the `contentType` property. The Block
2828

2929
> By default, the content type is set to `Text`.
3030
31+
### ContentType
32+
33+
```typescript
34+
// Adding inline text
35+
{
36+
blockType = "Paragraph",
37+
content = new List<object>()
38+
{
39+
new { contentType = 'Text', content = "Inline Text" }
40+
}
41+
}
42+
```
43+
3144
## Configure text content
3245

3346
You can configure Text content by setting the `contentType` property to `Text`. The default content type is `Text`.
@@ -46,6 +59,25 @@ Link settings accepts the following options:
4659
| ------------------------- | ----------------------------------------------------------------- | ------------- |
4760
|`url`| Specifies the destination URL of the link. | `''` |
4861

62+
### ContentType & Properties
63+
64+
```typescript
65+
{
66+
blockType = "Paragraph",
67+
content = new List<object>()
68+
{
69+
new
70+
{
71+
contentType = 'Link',
72+
content = 'hyperlinks',
73+
properties = {
74+
url = 'https://ej2.syncfusion.com/documentation',
75+
}
76+
}
77+
}
78+
}
79+
```
80+
4981
## Configure Label
5082

5183
You can render labels by setting the `contentType` property as `Label`. Additionally, by configuring the `properties` property, you can customize how labels behave in your editor. This setup allows you to define the trigger character and specify the available label items.
@@ -61,6 +93,19 @@ The Block Editor comes with offers different built-in options. These include:
6193

6294
You can customize the labels by using the `properties` property with type `Label`.
6395

96+
### ContentType & Properties
97+
98+
```typescript
99+
// Adding inline label
100+
{
101+
blockType = "Paragraph",
102+
content = new List<object>()
103+
{
104+
new {contentType = 'Label', properties = { lableId = "progress" }}
105+
}
106+
}
107+
```
108+
64109
### Trigger Character configuration
65110

66111
You can use the `triggerChar` property to specify the character that will trigger the label suggestions popup while typing. The default trigger character is `$`.
@@ -94,14 +139,29 @@ The below sample demonstrates the customization of labels in the Block Editor.
94139
{% endhighlight %}
95140
{% endtabs %}
96141

97-
![Block label-settings](images/block-label.png)
142+
![Block label-settings](./../../images/block-label.png)
98143

99144
## Configure mention
100145

101146
Mentions are references to users or entities that can be inserted into your content. You can configure mention content by setting the `contentType` property to `Mention`.
102147

103148
Mentions are typically triggered by the `@` character and are linked to the `Users` collection defined in the Block Editor.
104149

150+
### ContentType
151+
152+
```typescript
153+
// Adding inline code
154+
{
155+
blockType = "Paragraph",
156+
content = new List<object>()
157+
{
158+
new {
159+
contentType = "Mention", properties = new { userId = "user1" }
160+
}
161+
}
162+
}
163+
```
164+
105165
## Applying inline styles
106166

107167
The Block Editor allows you to apply rich formatting to block contents using the `styles` property.

ej2-asp-core-mvc/blockeditor/EJ2_ASP.MVC/built-in-blocks/list-types.md

Lines changed: 83 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,98 @@ domainurl: ##DomainURL##
1111

1212
# Lists in ##Platform_Name## Block Editor control
1313

14-
List blocks in the BlockEditor component are used to organize content into structured lists. You can render List blocks by setting the `blockType` property as `BulletList`, `NumberedList`, or `Checklist`. Bullet lists and numbered lists are ideal for unordered and ordered items, respectively, while checklist blocks enable interactive to-do lists with checkable items.
14+
List blocks in the BlockEditor component are used to organize content into structured lists. You can render List blocks by setting the [blockType](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html) property as [BulletList](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_BulletList), [NumberedList](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_NumberedList), or [Checklist](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Checklist). Bullet lists and numbered lists are ideal for unordered and ordered items, respectively, while checklist blocks enable interactive to-do lists with checkable items.
1515

1616
## Configure bullet list
1717

18-
You can render Bullet List block by setting the `blockType` property as `BulletList`. This block type is used for unordered lists.
18+
You can render Bullet List block by setting the [blockType](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html) property as [BulletList](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_BulletList). This block type is used for unordered lists.
19+
20+
### BlockType
21+
22+
```typescript
23+
// Adding bulletlist block
24+
{
25+
blockType = 'BulletList',
26+
content = new List<object>()
27+
{
28+
new
29+
{
30+
contentType = "Text"
31+
content = 'your content'
32+
}
33+
}
34+
}
35+
```
1936

2037
### Configure placeholder
2138

2239
You can configure placeholder text for block using the `placeholder` in the `properties` property. This text appears when the block is empty. The default placeholder for bullet list is `Add item`.
2340

41+
```typescript
42+
// Adding placeholder value
43+
{
44+
blockType = 'BulletList',
45+
properties = new { placeholder = "Add item" }
46+
}
47+
```
48+
2449
## Configure numbered list
2550

26-
You can render Numbered List block by setting the `blockType` property as `NumberedList`. This block type is used for ordered lists.
51+
You can render Numbered List block by setting the [blockType](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html) property as [NumberedList](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_NumberedList),. This block type is used for ordered lists.
52+
53+
### BlockType
54+
55+
```typescript
56+
// Adding bulletlist block
57+
{
58+
blockType = 'NumberedList',
59+
content = new List<object>()
60+
{
61+
new
62+
{
63+
contentType = "Text"
64+
content = 'your content'
65+
}
66+
}
67+
}
68+
```
2769

2870
### Configure placeholder
2971

3072
You can configure placeholder text for block using the `placeholder` in the `properties` property. This text appears when the block is empty. The default placeholder for numbered list is `Add item`.
3173

74+
```typescript
75+
// Adding placeholder value
76+
{
77+
blockType = 'NumberedList',
78+
properties = new { placeholder = "Add item" }
79+
}
80+
```
81+
3282
## Configure checklist
3383

34-
You can render Checklist block by setting the `blockType` property as `Checklist`. This block type is used for creating interactive to-do lists.
84+
You can render Checklist block by setting the [blockType](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html) property as [Checklist](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Checklist). This block type is used for creating interactive to-do lists.
85+
86+
### BlockType
87+
88+
```typescript
89+
// Adding bulletlist block
90+
{
91+
blockType = 'CheckList',
92+
content = new List<object>()
93+
{
94+
new
95+
{
96+
contentType = "Text"
97+
content = 'your content'
98+
}
99+
}
100+
}
101+
```
35102

36103
### Configure checked state
37104

38-
For blocks that support selection states such as `Checklist`, you can configure the checked state using the `properties` property with `isChecked`.
105+
For blocks that support selection states such as [Checklist](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.BlockEditor.BlockType.html#Syncfusion_EJ2_BlockEditor_BlockType_Checklist), you can configure the checked state using the `properties` property with `isChecked`.
39106

40107
By default, the `isChecked` property is set to `false`.
41108

@@ -48,23 +115,31 @@ By default, the `isChecked` property is set to `false`.
48115
{% endhighlight %}
49116
{% endtabs %}
50117

51-
![Block isChecked](images/block-ischecked.png)
118+
![Block isChecked](./../../images/block-ischecked.png)
52119

53120
### Configure placeholder
54121

55122
You can configure placeholder text for block using the `placeholder` in the `properties` property. This text appears when the block is empty. The default placeholder for check list is `Todo`.
56123

124+
```typescript
125+
// Adding placeholder value
126+
{
127+
blockType = 'Checklist',
128+
properties = new { placeholder = "Todo" }
129+
}
130+
```
131+
57132
## Configure list blocks
58133

59134
Below example illustrates how to render the different types of list blocks in the Block Editor.
60135

61136
{% tabs %}
62137
{% highlight razor tabtitle="CSHTML" %}
63-
{% include code-snippet/blockeditor/blocks/blockTypes/paragraph-block/razor %}
138+
{% include code-snippet/blockeditor/blocks/blockTypes/list-block/razor %}
64139
{% endhighlight %}
65140
{% highlight c# tabtitle="List.cs" %}
66141
{% include code-snippet/blockeditor/blocks/blockTypes/list-block/list.cs %}
67142
{% endhighlight %}
68143
{% endtabs %}
69144

70-
![List Block](images/block-list.png)
145+
![List Block](./../../images/block-list.png)

0 commit comments

Comments
 (0)