-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Preview flag in ContentByContentTypeQuery #229
Comments
Hi @jdpnielsen The reason The underlying call is to |
@nikcio That makes sense. I just took a look at the underlying code for GetByContentType: https://github.com/umbraco/Umbraco-CMS/blob/v12/dev/src/Umbraco.Core/PublishedCache/PublishedCacheBase.cs#L91-L98 (hope this is the correct one anyway) public virtual IEnumerable<IPublishedContent> GetByContentType(IPublishedContentType contentType) =>
// this is probably not super-efficient, but works
// some cache implementation may want to override it, though
GetAtRoot()
.SelectMany(x => x.DescendantsOrSelf(_variationContextAccessor!))
.Where(x => x.ContentType.Id == contentType.Id); It seems the GetAtRoot() function take a preview parameter. Do you think it would make sense to implement a variant of this with preview support in this repo? |
@jdpnielsen I never knew the implementation of But yeah we can totally replace Do you want to take a swing at opening a PR for it? |
BREAKING CHANGE: Adds VariationContextAccessor and preivew as parameters to the ContentByContentType Query fixes: #229
This will be included in version 5 |
Feature summary
Ideally, all 'basic queries' should support preview mode - this would make it much easier to build applications with preview support.
The text was updated successfully, but these errors were encountered: