Copied to clipboard

Flag this post as spam?

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


  • mmmoustache 50 posts 79 karma points
    Mar 07, 2012 @ 16:01
    mmmoustache
    0

    Skip property if empty: Cannot instantiate a DynamicNode without an id

    I have a section in my site where I want to render out all it's children (which are of the same doctype and include numerous properties) but I would like to 'skip' a property if it's empty, specifically an unused Content Picker, as this prevents the script from rendering if nothing is selected. I get the error message "Cannot instantiate a DynamicNode without an id" when debugging. Here's a snippet of my code:

    if(@child.HasProperty("contentPicker"&@ child.GetProperty("contentPicker").Value != String.Empty)
    {
    <p>Show content</p>
    }else{
            ***nothing***
    }
  • 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.

Please Sign in or register to post replies