I can see that the value for @linkedDoc is umb://document/1b7f16f0a9034dfeb3f7fb4fdd5b92f4 but I have no idea how to get the equivalent value for my current doc.
You don't need to call "Umbraco.TypedContentAtXPath($"//myDoctype[@linkedDoc= {Model.Content.Id}]")", you can use selected cotent item directly in the razor.
Just get all selected nodes with code like that:
var typedMultiNodeTreePicker = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("featuredArticles");
How does one use TypedContentAtXPath with MultiNodeTreePicker2
Does anyone know what the below should look like to work with the new
MultiNodeTreePicker2
?I can see that the value for
@linkedDoc
isumb://document/1b7f16f0a9034dfeb3f7fb4fdd5b92f4
but I have no idea how to get the equivalent value for my current doc.Hi Jason
"umb://document/1b7f16f0a9034dfeb3f7fb4fdd5b92f4" is an UDI, read more - https://our.umbraco.org/documentation/reference/querying/Udi
You don't need to call "Umbraco.TypedContentAtXPath($"//myDoctype[@linkedDoc= {Model.Content.Id}]")", you can use selected cotent item directly in the razor.
Just get all selected nodes with code like that:
I need all documents of type
myDocType
where the property value forlinkedDoc
is my current page - sorry, intial xpath was wrong. Have now fixed.Thanks Alex for the link,
It turns out this is two step process.
This is useful, thanks.
Just to expand, if you are allowing multiple items to be picked, you can use the xpath query
contains
:is working on a reply...