mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-17 19:30:59 +08:00
flag exclude children for taxonomies (#8481)
This commit is contained in:
parent
230dfc30da
commit
f23d9292c5
@ -47,7 +47,10 @@ namespace Orchard.Taxonomies.Projections {
|
|||||||
var terms = ids.Select(_taxonomyService.GetTerm).ToList();
|
var terms = ids.Select(_taxonomyService.GetTerm).ToList();
|
||||||
var allChildren = new List<TermPart>();
|
var allChildren = new List<TermPart>();
|
||||||
foreach (var term in terms) {
|
foreach (var term in terms) {
|
||||||
|
bool.TryParse(context.State.ExcludeChildren?.Value, out bool excludeChildren);
|
||||||
|
if (!excludeChildren)
|
||||||
allChildren.AddRange(_taxonomyService.GetChildren(term));
|
allChildren.AddRange(_taxonomyService.GetChildren(term));
|
||||||
|
if (term != null)
|
||||||
allChildren.Add(term);
|
allChildren.Add(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,11 @@ namespace Orchard.Taxonomies.Projections {
|
|||||||
Id: "operator-is-all-of", Name: "Operator",
|
Id: "operator-is-all-of", Name: "Operator",
|
||||||
Title: T("Is all of"), Value: "1"
|
Title: T("Is all of"), Value: "1"
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
_ExcludeChildren: Shape.Checkbox(
|
||||||
|
Id: "ExcludeChildren", Name: "ExcludeChildren",
|
||||||
|
Title: T("Automatically exclude children terms in filtering"),
|
||||||
|
Value: "true"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user