-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SeoSchema added to support schema.org scripts
- Loading branch information
Uğurhan Gül
committed
May 31, 2023
1 parent
776560b
commit f4a5af4
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/SeoToolkit.Umbraco.MetaFields.Core/Models/SeoField/SeoSchemaField.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using Microsoft.AspNetCore.Html; | ||
using Umbraco.Cms.Core.Composing; | ||
using SeoToolkit.Umbraco.MetaFields.Core.Common.SeoFieldEditEditors; | ||
using SeoToolkit.Umbraco.MetaFields.Core.Constants; | ||
using SeoToolkit.Umbraco.MetaFields.Core.Interfaces.SeoField; | ||
using SeoToolkit.Umbraco.MetaFields.Core.Models.SeoFieldEditors; | ||
|
||
namespace SeoToolkit.Umbraco.MetaFields.Core.Models.SeoField | ||
{ | ||
[Weight(200)] | ||
public class SeoSchemaField : ISeoField | ||
{ | ||
public string Title => "Schema"; | ||
public string Alias => SeoFieldAliasConstants.Schema; | ||
public string Description => "The schemas are a set of 'types', each associated with a set of properties. The types are arranged in a hierarchy."; | ||
public string GroupAlias => SeoFieldGroupConstants.MetaFieldsGroup; | ||
public Type FieldType => typeof(string); | ||
|
||
public ISeoFieldEditor Editor => new SeoFieldFieldsEditor(new[] { "Umbraco.TextBox", "Umbraco.TextArea", "Umbraco.TinyMCE" }); | ||
public ISeoFieldEditEditor EditEditor => new SeoTextAreaEditEditor(); | ||
|
||
public HtmlString Render(object value) | ||
{ | ||
return new HtmlString($"<script type=\"application/ld+json\" />{value}</script>"); | ||
} | ||
} | ||
} |