OrchardCore.DisplayManagement.Implementation.DefaultHtmlDisplay.ExecuteAsync(DisplayContext context)
. Could I replace the default implementation and debug it?
@/all We are saddened to inform you that Piotr Szmyd, one of our founding contributors, has passed away. Piotr was a friend to all of us. To pay our respect we have created a thread where people can share memories and messages.
public class MyContentTypeDriver : ContentDisplayDriver
{
private readonly ClassDetailsAccessor _classDetailsAccessor;
// .... other services used
public MyContentTypeDriver(ClassDetailsAccessor classDetailsAccessor, /* other injected services */) { _classDetailsAccessor = classDetailsAccessor }
public override async Task<IDisplayResult> DisplayAsync(ContentItem model, BuildDisplayContext context)
{
if (!CanHandleModel(model))
{
return null;
}
// Allows a user to preview the class details instead of only retrieving the class details when
// we access the content from the known url route. The content preview functionality uses a
// different route.
if (_classDetailsAccessor.ClassDetails is null)
{
var classId = int.TryParse(_httpContextAccessor?.HttpContext?.Request.Query["classId"], out var id)
? id
: 23798;
_classDetailsAccessor.ClassDetails = await _classDetailsService.GetClassDetailsAsync(classId);
}
// We return a null shape since we did not render the content type
return null;
}
public override bool CanHandleModel(ContentItem model)
{
return model.ContentType == "MyContentTypeTechnicalName";
}
}
Trying to configure a single-host SPA/API/OrchardCoreHeadless application, I have mapped orchard core behind the path "/cms"
My spa works as expected however when I navigate to "/cms" I get this error.
InvalidOperationException: Unable to resolve service for type 'OrchardCore.Documents.IDocumentManager`1[OrchardCore.Settings.SiteSettings]' while attempting to activate 'OrchardCore.Settings.Services.SiteService'.
Can provide my startup.cs, just don't want to spam gitter with a ton of lines.
Will send that file in a gist
services.AddOrchardCore()
is for decoupled and/or headless sites, correct? While services.AddOrchardCoreCms()
is needed when you'll actually use OC to render the tenant site.
Include in Index
field checked. Is there a reason why they would be included automatically without intentionally doing so?
Hello everyone, does anybody know how to run this command? I could not find any example how to use it.
https://github.com/OrchardCMS/OrchardCore/blob/dev/src/OrchardCore.Modules/OrchardCore.Demo/Commands/DemoCommands.cs#L19
I think it can be useful for creating a helper tool.