Find nodes in which a specific node is referenced in a MNTP
I have a MNTP property "tags" on different nodes across my site tree. On this property the editors can pick from category nodes. Say I have a category node with id 1151 - then I want to query for all nodes that has this node referenced in their "tags" property.
Find nodes in which a specific node is referenced in a MNTP
I have a MNTP property "tags" on different nodes across my site tree. On this property the editors can pick from category nodes. Say I have a category node with id 1151 - then I want to query for all nodes that has this node referenced in their "tags" property.
I found something I thought was right here (https://our.umbraco.com/forum/using-umbraco-and-getting-started/97468-get-and-store-values-of-a-multi-node-tree-picker-into-a-list-of-strings and https://our.umbraco.com/packages/developer-tools/umbraco-core-property-value-converters/feedback/64461-How-to-query-for-mntp-value) and made it v8 compatible (changed "GetPropertyValue" to "Value"):
But I get this error (on the second line):
Any ideas?
Check for null first.
HTH
Steve
Should probably add this looks to be a quite an expensive query - you're checking all descendants here.
If this is totally necessary you might want to look at caching this.
Steve
Yes, I guess you are right. The nodes are spread around the site tree so it is necessary.
After Descendants() I have .Where(x => x.IsDocumentType(articleType.Key)) but I guess that only helps a little.
is working on a reply...