Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi everyone,
I have a macro that performs a search by tag.My purpose is to retrieve all the nodes of a certain document type that contains a tag in their tag field@Model.Content.Parent.Descendants("mydoctype").Where("Visibile")this retrieves all elements... now i have to filter by the tag field, but i can't use lamba expression and I have no idea how to express the filter that is something like
node => node.GetProperty("tagField").Value.ToLower().Contains("myTag".ToLower());It's possible? Or I have to find a different way?----Another question: can someone give me some direction to use examine (only on some doctypes and only on some fileds) ?Thank you
Hello,
If you use Model.Content it's strongly typed and you should be able to use lamba experessions. See this for more info: http://our.umbraco.org/documentation/Reference/Mvc/querying#Complexquerying(Where)
Jeroen
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Macro: node querying
Hi everyone,
I have a macro that performs a search by tag.
My purpose is to retrieve all the nodes of a certain document type that contains a tag in their tag field
@Model.Content.Parent.Descendants("mydoctype").Where("Visibile")
this retrieves all elements... now i have to filter by the tag field, but i can't use lamba expression and I have no idea how to express the filter that is something like
node => node.GetProperty("tagField").Value.ToLower().Contains("myTag".ToLower());
It's possible? Or I have to find a different way?
----
Another question: can someone give me some direction to use examine (only on some doctypes and only on some fileds) ?
Thank you
Hello,
If you use Model.Content it's strongly typed and you should be able to use lamba experessions. See this for more info: http://our.umbraco.org/documentation/Reference/Mvc/querying#Complexquerying(Where)
Jeroen
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.