Knowit.SeoOrganizationSchema.Optimizely 1.0.3

dotnet add package Knowit.SeoOrganizationSchema.Optimizely --version 1.0.3
                    
NuGet\Install-Package Knowit.SeoOrganizationSchema.Optimizely -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Knowit.SeoOrganizationSchema.Optimizely" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Knowit.SeoOrganizationSchema.Optimizely" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Knowit.SeoOrganizationSchema.Optimizely" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Knowit.SeoOrganizationSchema.Optimizely --version 1.0.3
                    
#r "nuget: Knowit.SeoOrganizationSchema.Optimizely, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Knowit.SeoOrganizationSchema.Optimizely@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Knowit.SeoOrganizationSchema.Optimizely&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Knowit.SeoOrganizationSchema.Optimizely&version=1.0.3
                    
Install as a Cake Tool

Knowit.SeoOrganizationSchema.Optimizely

Provides a simple way to configure and render Organization Schema defined by https://schema.org/

Getting Started

Installation

In order to install it use following command:


	dotnet add package Knowit.SeoOrganizationSchema.Optimizely --source https://www.myget.org/F/creuna-nuget/api/v3/index.json

After installation:

  • Open Startup.cs
  • Register SeoOrganizationSchema services with extension method AddSeoOrganizationSchema

example:


	public void ConfigureServices(IServiceCollection services)
	{
		if (webHostingEnvironment.IsDevelopment())
		{
			AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(webHostingEnvironment.ContentRootPath, "App_Data"));

			services.Configure<SchedulerOptions>(options => options.Enabled = false);
		}

		services
			.AddCmsAspNetIdentity<ApplicationUser>()
			.AddCms()
			.AddAdminUserRegistration()
			.AddEmbeddedLocalization<Startup>();

		services.AddSeoOrganizationSchema();
	}

  • In case if you have page type restrictions defined please make sure OrganizationSchemaSettingsPage is allowed to be created under Root and site start pages.
  • Difine Meta section in the page layout view.

example:


	@using EPiServer.Framework.Web.Mvc.Html

	@model IPageViewModel<SitePageData>

	<!DOCTYPE html>
	<html lang="@(Model.CurrentPage.Language)">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=10" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>@Model.CurrentPage.MetaTitle</title>
		@if (Model.CurrentPage.MetaKeywords != null && Model.CurrentPage.MetaKeywords.Count > 0)
		{
			<meta name="keywords" content="@string.Join(",", Model.CurrentPage.MetaKeywords)" />
		}
		@if (!string.IsNullOrWhiteSpace(Model.CurrentPage.MetaDescription))
		{
			<meta name="description" content="@Model.CurrentPage.MetaDescription" />
		}
		@Html.CanonicalLink()
		@Html.AlternateLinks()

		@await RenderSectionAsync("Meta", false)

		<link rel="stylesheet" href="~/css/bootstrap.min.css" />
		<link rel="stylesheet" href="~/css/style.min.css" />
		<link rel="stylesheet" href="~/css/theme.min.css" />
		<link rel="shortcut icon" href="~/favicon.ico" type="image/x-icon" />
		<required-client-resources area="Header" />
	</head>

...

  • render Organization Schema in the Meta section of site start page View

example:


	@using EPiServer.Web.Mvc.TagHelpers
	@using Knowit.SeoOrganizationSchema.Optimizely.Html
	@inherits AlloyTestSite.Views.AlloyPageBase<PageViewModel<AlloyTestSite.Models.Pages.StartPage>>

	@section Meta
	{
		@Html.SeoOrganizationSchema()
	}

	<div class="start">
		<div epi-property="@Model.CurrentPage.MainContentArea" class="row">
			<div epi-property-item class="block" epi-on-item-rendered="OnItemRendered" />
		</div>
	</div>

  • run the web site and create OrganizationSchemaSettingsPage under Root or the site home page, fill it with required data.

    NOTE: Settings under site root has higher prority over under root, so common settings can be overriden for specific site, if page has not been translated for specific language, the master version is taken.

  • go to the site home page URL and make sure organization schema json is in place checking rendered html

Advanced Setup

If OrganizationSchemaSettingsPage type is not meet your needs for some reason it is possible to define custom one followign the rules:

  • The page should be inherited from OrganizationSchemaSettingsPageBase class or IOrganizationSchemaSettings interface
  • Schema properties should be marked with SchemaFieldAttribute

    NOTE: supported proprty types - simple types like string, int etc., EPiServer.Url, EPiServer.Core.ContentReference and EPiServer.SpecializedProperties.LinkItemCollection(could be extended in the future) in case if you need to extend/customize the list of supported types you can implement and register custom ISchemaValueConverter/ ISchemaValueCollectionConverter

  • It is possible to define blocks and use them as property type to define multi-field element like address.
  • Another approhach is to use . path separator in the schema field key like this [SchemaField("contactPoint.email")]

example:


	[ContentType(
		GUID = "5a833aab-3a6b-4708-bdaf-11d904da8845",
		DisplayName = "[SEO] Organization Schema Settings")]
	public class OrganizationSchemaSettingsPage : OrganizationSchemaSettingsPageBase
	{
		[Display(Name = "Image", Order = 110)]
		[UIHint(UIHint.Image)]
		[CultureSpecific]
		[SchemaField("image")]
		public virtual ContentReference? Image { get; set; }

		[Display(Name = "Logo", Order = 120)]
		[UIHint(UIHint.Image)]
		[CultureSpecific]
		[SchemaField("logo")]
		public virtual ContentReference? Logo { get; set; }

		[Display(Name = "Organization Name", Order = 130)]
		[CultureSpecific]
		[SchemaField("name")]
		public virtual string? OrganizationName { get; set; }

		[Display(Name = "Description", Order = 140)]
		[CultureSpecific]
		[SchemaField("description")]
		[UIHint(UIHint.Textarea)]
		public virtual string? Description { get; set; }

...

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 353 5/4/2026

Absolute url resolving fixes