Class MetaTag
Represents a meta tag to be inserted into the iframe's head.
Inheritance
Namespace: Syncfusion.Blazor.RichTextEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class MetaTag : Object
Remarks
This class allows the configuration of meta tags within the iframe, enhancing both SEO and content representation.
Constructors
MetaTag()
Declaration
public MetaTag()
Properties
Charset
Gets or sets the charset attribute of the meta tag, defining the character encoding for the document.
Declaration
public string Charset { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string specifying the character set. |
Remarks
Charset dictates text encoding, ensuring proper interpretation and display of textual content.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorIFrameSettings Enable="true" MetaTags="@metaTags" />
</SfRichTextEditor>
@code {
private List<MetaTag> metaTags = new List<MetaTag>()
{
new MetaTag { Charset = "UTF-8" },
};
}
Content
Gets or sets the content attribute of the meta tag, which holds the value of the meta information.
Declaration
public string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string containing the meta information's actual data. |
Remarks
Content serves as the substantive data conveyed by the meta tag, integral to understanding document intentions.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorIFrameSettings Enable="true" MetaTags="@metaTags" />
</SfRichTextEditor>
@code {
private List<MetaTag> metaTags = new List<MetaTag>()
{
new MetaTag { Content = "This is a description" },
};
}
HttpEquiv
Gets or sets the http-equiv attribute of the meta tag, used to simulate an HTTP header.
Declaration
public string HttpEquiv { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string denoting the HTTP-equivalent directive. |
Remarks
HttpEquiv is akin to response headers, equipping documents with security or functionality directives.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorIFrameSettings Enable="true" MetaTags="@metaTags" />
</SfRichTextEditor>
@code {
private List<MetaTag> metaTags = new List<MetaTag>()
{
new MetaTag { HttpEquiv = "Content-Security-Policy", Content = "default-src 'self'" },
};
}
Name
Gets or sets the name attribute of the meta tag, used to specify the type of metadata (e.g., "description", "keywords").
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that identifies the nature of the meta data. |
Remarks
Name acts as an identifier for metadata types, critical for document classification and search engine optimization.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorIFrameSettings Enable="true" MetaTags="@metaTags" />
</SfRichTextEditor>
@code {
private List<MetaTag> metaTags = new List<MetaTag>()
{
new MetaTag { Name = "description" },
};
}
Property
Gets or sets the property attribute of the meta tag, often used for the Open Graph protocol to describe web content.
Declaration
public string Property { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the Open Graph property. |
Remarks
Property enhances the representation of web content for social media and sharing, particularly through Open Graph.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorIFrameSettings Enable="true" MetaTags="@metaTags" />
</SfRichTextEditor>
@code {
private List<MetaTag> metaTags = new List<MetaTag>()
{
new MetaTag { Property = "og:title", Content = "Example Title" },
};
}