If you'r talking about the Multinode treepicker I'd do the following.
I always assume if no Id is picked the length of the comma separated string is empty. Therefore there's no Id in it. If you pick a node than it will contain a Id.
So if you just want to check if there is one or more Id's in the picker I'd do a
I need to check if an id is set in the multi node value.
So if in my backoffice I have assigned 2 nodes to my property the value of this property will be something like "1067,1066". So the ids of the nodes selected.
Now in my code I have an id and I need to check this if this is a selected node of the property.
Check if multi content node property has id
Hi all,
is there a quick utility function to check if an id is present in the muli content node property?
For instance I have a published content node of type
Company
which has a property calledCategories
which is a multi node content picker.For example it has the value
"1067, 1066"
.Now in my code I need to check if an id is present in here.
Anyone that can help me?
/Michaël
If you'r talking about the Multinode treepicker I'd do the following.
I always assume if no Id is picked the length of the comma separated string is empty. Therefore there's no Id in it. If you pick a node than it will contain a Id.
So if you just want to check if there is one or more Id's in the picker I'd do a
Hi Frans,
I need to check if an id is set in the multi node value. So if in my backoffice I have assigned 2 nodes to my property the value of this property will be something like
"1067,1066"
. So the ids of the nodes selected.Now in my code I have an id and I need to check this if this is a selected node of the property.
/Michaël
Ah, sorry I misunderstood you.
I always use Linq (using System.Linq)
Notice the single quotes behind the Split. If you use double quotes it wont work.
Hi Frans,
thanks for this solution!
/Michaël
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.