Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alex Perotti 53 posts 94 karma points
    Feb 10, 2014 @ 11:55
    Alex Perotti
    0

    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

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 10, 2014 @ 12:03
    Jeroen Breuer
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft