So I have a multiple dropdown picker, all works great. However I have a special page where I want items tagged with A but not B. So I can look for A, that works... but items tagged A and B also show. I want to make sure I get A but only if it's also NOT tagged B. A + C would be ok... but if B is one of the tags... I don't want it
How do I do this in Razor? How would I build the rest of this query?
var page in currentNode.Children.Where("Visible").Where("something.Contains(\"A\")")
I'd also like to note... I currently have a conditional inside my loop to hide the undesired items... but I would like a better query/collection. I'd like to do a count on the number of items in the collection for example.
Razor - where contains NOT = something
Hello,
So I have a multiple dropdown picker, all works great. However I have a special page where I want items tagged with A but not B. So I can look for A, that works... but items tagged A and B also show. I want to make sure I get A but only if it's also NOT tagged B. A + C would be ok... but if B is one of the tags... I don't want it
How do I do this in Razor? How would I build the rest of this query?
var page in currentNode.Children.Where("Visible").Where("something.Contains(\"A\")")
here's the actual query...
var stuff= Umbraco.Content(111).Children
.Where("Visible")
.Where("stuffTypes.Contains(\"Stuff A\")")
so I need the exclude here ---> .Where("stuffTypes.Contains(\"Stuff B\")")
.OrderBy("CreateDate desc");
I'd also like to note... I currently have a conditional inside my loop to hide the undesired items... but I would like a better query/collection. I'd like to do a count on the number of items in the collection for example.
Hi Greg,
Here's how I would approach this one:
Hope this makes sense?
Jeavon
Thanks Jeavon... I'll be trying this our shortly, but yes... makes total sense. Thank you so much!
is working on a reply...