mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 04:19:04 +08:00
Adding support for fetching of element descriptors from the blue print element harvester.
The problem before this change was that the cache manager would cache an empty list of elements when trying to locate a blueprint element without specifying a content item. The VaryByParam property allows additional control over the cache key.
This commit is contained in:
@@ -28,8 +28,8 @@ namespace Orchard.Layouts.Providers {
|
||||
var blueprints = _elementBlueprintService.Value.GetBlueprints().ToArray();
|
||||
|
||||
var query =
|
||||
from blueprint in blueprints
|
||||
let describeContext = DescribeElementsContext.Empty
|
||||
from blueprint in blueprints
|
||||
let describeContext = new DescribeElementsContext { Content = context.Content, CacheVaryParam = "Blueprints"}
|
||||
let baseElementDescriptor = _elementManager.Value.GetElementDescriptorByTypeName(describeContext, blueprint.BaseElementTypeName)
|
||||
let baseElement = _elementManager.Value.ActivateElement(baseElementDescriptor)
|
||||
select new ElementDescriptor(
|
||||
|
||||
Reference in New Issue
Block a user