Copied to clipboard

Flag this post as spam?

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


  • Michael Sims 119 posts 387 karma points
    Jul 25, 2013 @ 13:41
    Michael Sims
    0

    Selected checklist options not returning

    I have a checklist datatype with a number of options. I have added a property to my doc type with this data type. On several content nodes of this doc type I have selected multiple options for that property, however, in those instances (when more than 1 option is chosen) I get back a null value and node.HasValue("myProperty") returns false.

    Any ideas what I am doing wrong?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 25, 2013 @ 13:43
    Jan Skovgaard
    0

    Hi Michael

    Would you mind sharing the code you're currently working on?

    It will make it easier to figure out the solution :)

    /Jan

  • Michael Sims 119 posts 387 karma points
    Jul 25, 2013 @ 13:46
    Michael Sims
    0

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using umbraco.MacroEngines
    @using System.Xml.XPath

    @{
    var items = Model.Children.Where("Visible");
    }

    <ul id="portfolio">
    @for (int i = 0; i < items.Count(); i++){
    var item = items[i];
    if (item.HasValue("solutions")) {
    string[] solutions = item.Solutions.Split(',');
    @Html.Raw(item.Solutions)
    } else {
    @Html.Raw("No results")
    }
    }
    </ul>

Please Sign in or register to post replies

Write your reply to:

Draft