etchuk / etch.orchardcore.contextualedit Goto Github PK
View Code? Open in Web Editor NEWOrchard Core module for displaying edit control for page being viewed.
License: MIT License
Orchard Core module for displaying edit control for page being viewed.
License: MIT License
Just checked the error logs on a site running RC2 and spotted this warning:
The content part display driver 'Etch.OrchardCore.ContextualEdit.Drivers.ContextualEditPartDisplay' should not be registered in DI. Use UseDisplayDriver instead.
I've used your NuGet package in current version 1.4.0 in OrchardCore site and followed your instructions. Widget is displayed on homepage only.
So I downloaded your source code from github and referenced project to be able to debug.
The problem I've found is in the ContextualEditService
, method GetContentItemForRequestAsync
, line 42. The variable contentItemId
is always null
. And the reason is that _contentHandleProvider
instance variable is AliasPartContentHandleProvider
type instead of expected AutorouteHandleProvider
type.
One solution that works for me is replace IContentHandleProvider with IContentHandleManager. It will use all content handle providers ordered by Order property and return first successfull result.
Another solution, that also works is to resolve AutorouteHandleProvider
from content handle provider collection registered in dependency injection container. This solution will use only expected content handle provider. May there is another solution to resolve correct service from DI but currently I don't know how.
public ContextualEditService(IEnumerable<IContentHandleProvider> contentHandleProviders, IContentManager contentManager, IHttpContextAccessor httpContextAccessor, ISiteService siteService)
{
_contentHandleProvider = contentHandleProviders.OfType<AutorouteHandleProvider>().First();
_contentManager = contentManager;
_httpContextAccessor = httpContextAccessor;
_siteService = siteService;
}
Having a minimised state would be useful so as to not interfere so much with the page rendering.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.