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
When I try this:
@Model.NodeById(parentNode).DescendantsOrSelf().Where("nodeTypeAlias != \"Archive\"")
I'm getting an error:
"Cannot invoke a non-delegate type"
Using 4.7.0
Should that work?
This works fine:
@Model.NodeById(parentNode).DescendantsOrSelf().Where("nodeTypeAlias.Contains(\"Story\")")
Hi Jason,
Give this a try:
@Model.DescendantsOrSelf().Where("!nodeTypeAlias.Equals(\"Archive\")")
Still getting that error. It's like when I use not (!) then it throws the error.
Hm. Try posting your script - I tried the above expression and didn't get any error regardless of what I was comparing the nodeTypeAlias to...
Also, is that the full error you are getting?
Model.DescendantsOrSelf("Archive") ... Looks fine to me ... But it's not :-)) Sorry
Use not insteed of ! =>
@Model.DescendantsOrSelf().Where("not(nodeTypeAlias.Equals(\"Archive\"))")
OK, I did a smaller test and both of these methods work. Thanks guys!
Unfortunately, that means the problem is elsewhere...
Model.Descendants.Where("NodeTypeAlias == \"externalCollection\" || NodeTypeAlias == \"individualCollection\"");
any reason why that doesn't work??
nodeTypeAlias :-)
nope still doesn't work
var allCollectionItems = Model.Descendants.Where("nodeTypeAlias.Equals(\"externalCollection\") || nodeTypeAlias.Equals(\"individualCollection\")");
if(allCollectionItems != null) { <ul> @foreach (var item in allCollectionItems) { <li><a href="@item.Url"@cssClassForItem(item)>@item.Name</a></li> } </ul> }
The Where function accepts operators such as equal, contains ect... does anyone have a list of these or know where I could find a list? Would be very handy.
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
Error when trying to find documents without a certain nodeTypeAlias
When I try this:
@Model.NodeById(parentNode).DescendantsOrSelf().Where("nodeTypeAlias != \"Archive\"")
I'm getting an error:
"Cannot invoke a non-delegate type"
Using 4.7.0
Should that work?
This works fine:
@Model.NodeById(parentNode).DescendantsOrSelf().Where("nodeTypeAlias.Contains(\"Story\")")
Hi Jason,
Give this a try:
@Model.DescendantsOrSelf().Where("!nodeTypeAlias.Equals(\"Archive\")")
Still getting that error. It's like when I use not (!) then it throws the error.
Hm. Try posting your script - I tried the above expression and didn't get any error regardless of what I was comparing the nodeTypeAlias to...
Also, is that the full error you are getting?
Model.DescendantsOrSelf("Archive") ... Looks fine to me ... But it's not :-)) Sorry
Use not insteed of ! =>
@Model.DescendantsOrSelf().Where("not(nodeTypeAlias.Equals(\"Archive\"))")
OK, I did a smaller test and both of these methods work. Thanks guys!
Unfortunately, that means the problem is elsewhere...
Model.Descendants.Where("NodeTypeAlias == \"externalCollection\" || NodeTypeAlias == \"individualCollection\"");
any reason why that doesn't work??
nodeTypeAlias :-)
nope still doesn't work
var allCollectionItems = Model.Descendants.Where("nodeTypeAlias.Equals(\"externalCollection\") || nodeTypeAlias.Equals(\"individualCollection\")");
if(allCollectionItems != null)
{
<ul>
@foreach (var item in allCollectionItems)
{
<li><a href="@item.Url"@cssClassForItem(item)>@item.Name</a></li>
}
</ul>
}
var allCollectionItems = Model.Descendants.Where("nodeTypeAlias.Equals(\"externalCollection\") || nodeTypeAlias.Equals(\"individualCollection\")");
if(allCollectionItems != null)
{
<ul>
@foreach (var item in allCollectionItems)
{
<li><a href="@item.Url"@cssClassForItem(item)>@item.Name</a></li>
}
</ul>
}
The Where function accepts operators such as equal, contains ect... does anyone have a list of these or know where I could find a list? Would be very handy.
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.