Copied to clipboard

Flag this post as spam?

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


  • simon eriksen 24 posts 113 karma points
    Jun 10, 2016 @ 09:27
    simon eriksen
    0

    macro outputting ids instead of text

    Hello

    I have an application where i need to output some fields when an item is chosen in a dropdownlist. i have a macro that choses what to output, but instead of outputting the value of the fields it outputs the ids or something.. looks like this: <option><MultiNodePicker type="content"><NodeId>1700</nodeId></MultiNodePicker></option>

    Code in macro:

    @{ var biler = Umbraco.Content(1674).Children(); }

    @foreach (var item in biler){
    if (item.DocumentTypeAlias == "Leasingcar")
    {
        <option>@Html.Raw(item.wwbilmaerke)</option>
    }
    else
    { }}
    
  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Jun 10, 2016 @ 09:39
    Dennis Aaen
    0

    Hi Simon and welcome to our.

    Have you seen the documentation for the MultiNode TreePicker there are some great examples on how to get the data from the picked items both in dynamic Razor and strongly typed Razor.

    https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/multinode-treepicker

    Hope this can help you further.

    /Dennis

  • simon eriksen 24 posts 113 karma points
    Jun 10, 2016 @ 09:50
    simon eriksen
    0

    Hi Dennis

    thanks ill look at it!

  • simon eriksen 24 posts 113 karma points
    Jun 13, 2016 @ 09:25
    simon eriksen
    0

    still need help on this one.. Current code =

    @{
    var biler = Umbraco.Content(1674).Children();}
    @foreach (var item in biler){
    if (item.DocumentTypeAlias == "Leasingcar")
    { 
    
    
            <option>@Umbraco.Content(item.wwbilmaerke).Name</option>}
    else
    { }}
    
Please Sign in or register to post replies

Write your reply to:

Draft