Esatto.Umbraco.Backoffice.CrossContent
1.1.0
dotnet add package Esatto.Umbraco.Backoffice.CrossContent --version 1.1.0
NuGet\Install-Package Esatto.Umbraco.Backoffice.CrossContent -Version 1.1.0
<PackageReference Include="Esatto.Umbraco.Backoffice.CrossContent" Version="1.1.0" />
<PackageVersion Include="Esatto.Umbraco.Backoffice.CrossContent" Version="1.1.0" />
<PackageReference Include="Esatto.Umbraco.Backoffice.CrossContent" />
paket add Esatto.Umbraco.Backoffice.CrossContent --version 1.1.0
#r "nuget: Esatto.Umbraco.Backoffice.CrossContent, 1.1.0"
#:package Esatto.Umbraco.Backoffice.CrossContent@1.1.0
#addin nuget:?package=Esatto.Umbraco.Backoffice.CrossContent&version=1.1.0
#tool nuget:?package=Esatto.Umbraco.Backoffice.CrossContent&version=1.1.0
Esatto.Umbraco.Backoffice.CrossContent
Cross-site content teasers for Umbraco 17 & 18.
Scope: by default (no
ContentTypesconfigured) this package listscontentType:casePagefrom the target's Delivery API and storestype: "casePage". To pull multiple content types, setCrossContent:ContentTypes(see Pulling multiple content types) — the picker then lists each type, tags every item with its type, and shows a type-filter dropdown. For a single differently-named type, overrideCrossContent:CaseListPathwith your own Delivery-API filter instead (the consumer only uses each item'sid/name). The consumer decides how to render each type.
Install
Add the package.
Configure the site you want to read:
"CrossContent": { "BaseUrl": "https://othersite.example", "ApiKey": "<the other site's Umbraco:CMS:DeliveryApi:ApiKey>" }To let other sites read this one, enable the Delivery API and set its key, and register your own
ICrossContentTeaserMapper(see the interface docs):builder.Services.AddSingleton<ICrossContentTeaserMapper, MyMapper>();The package defaults to the shipped
NullCrossContentTeaserMapper(registered viaTryAddSingleton), so the producer endpoint returns 404 instead of failing to activate on consumer-only installs. A producer site's own registration above wins over this default regardless of registration order, so no manual step is required to opt out of the default.
The backoffice picker UI alias is Esatto.Umbraco.Backoffice.CrossContent.CasePicker (backed by Umbraco.Plain.Json).
Pulling multiple content types
Set CrossContent:ContentTypes to the doc types you want pickable:
"CrossContent": {
"BaseUrl": "https://othersite.example",
"ApiKey": "…",
"ContentTypes": [
{ "Alias": "casePage", "Label": "Cases" },
{ "Alias": "articlePage", "Label": "Articles" }
]
}
- The list client issues one Delivery-API query per type and merges the results; each picker item
and stored value carries its own
type. - The picker shows a type-filter dropdown (hidden when only one type is configured).
Labelis the dropdown text; it falls back toAliaswhen omitted.- Producer obligation: the target site's
ICrossContentTeaserMappermust handle every doc type its consumers can pick (it maps by node, returningnullfor anything it doesn't recognise → the teaser endpoint 404s). - Rendering each type's card is the consuming site's job — the package hands over
typein both the picker value and theCrossContentTeaser. - Leaving
ContentTypesempty (or unset) keeps the pre-1.1 single-CaseListPathbehaviour (items taggedcasePage), so existing installs are unaffected.
Install (full — consumer + producer)
To consume another site's cases:
Reference the package.
CrossContentconfig → the site you read:"CrossContent": { "BaseUrl": "https://othersite.example", "ApiKey": "<other site's DeliveryApi key>", "TeaserPath": "api/crosscontent/teaser" }(Override
TeaserPathonly if the target serves its teaser on a non-default/legacy route instead of this package'sapi/crosscontent/teaser.)Copy the three sample configs into your site's uSync folders, regenerating every GUID, and add
crossContentCasePageto yourcaseListingPage's<Structure>. They live underdocs/sample-usync/{DataTypes,ContentTypes,Templates}/, mirroring your site's own uSync folder structure — copy each file into the matching uSync folder:docs/sample-usync/DataTypes/CrossContentCasePicker.config→ your uSyncDataTypes/docs/sample-usync/ContentTypes/crosscontentcasepage.config→ your uSyncContentTypes/docs/sample-usync/Templates/CrossContentCasePage.config→ your uSyncTemplates/
The backoffice picker (
Esatto.Umbraco.Backoffice.CrossContent.CasePicker) ships with the package — no manifest entry needed.Add a redirect template
CrossContentCasePage.cshtml(non-genericUmbracoViewPage, read{key}viaValue<object>(),@inject ICrossContentTeaserClient, 302 → teaserUrl).Render: generalize your case-listing rendering to a source-agnostic card that reads either local media or the teaser's absolute
TeaserImageUrl; fetch cross-content teasers viaICrossContentTeaserClient.Add the target host to your CSP
img-src(teaser images are absolute URLs on the other site).
To be read by another site (producer):
- Enable the Delivery API:
Umbraco:CMS:DeliveryApi { "Enabled": true, "PublicAccess": false, "ApiKey": "<your key>" }. - Register a mapper:
builder.Services.AddSingleton<ICrossContentTeaserMapper, MyMapper>();mapping your case doc type →CrossContentTeaser. (Without one, the shippedNullCrossContentTeaserMapperdefault makes the endpoint 404.)
The consumer's CrossContent:ApiKey must equal the producer's Umbraco:CMS:DeliveryApi:ApiKey.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- MessagePack (>= 3.1.7)
- Microsoft.OpenApi (>= 2.7.5)
- Umbraco.Cms.Api.Management (>= 17.0.0)
- Umbraco.Cms.Core (>= 17.0.0)
- Umbraco.Cms.Web.Common (>= 17.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.