Copied to clipboard

Flag this post as spam?

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


  • Jon Ivar Nielsen 24 posts 96 karma points
    Feb 25, 2013 @ 00:30
    Jon Ivar Nielsen
    0

    Problem with uComponents Multi-URL Picker

    I'm using version 4.11.3 and uComponents 5.3.2 and I have a problem with Multi-URL Picker.

    My XML is;

    <relatedLinks>
    <multi-url-picker>
    <url-picker mode="URL">
    <new-window>True</new-window>
    <node-id />
    <url>www.vg.no</url>
    <link-title>Link 1</link-title>
    </url-picker>
    <url-picker mode="Content">
    <new-window>False</new-window>
    <node-id>1054</node-id>
    <url>/en/about/</url>
    <link-title>Link 2</link-title>
    </url-picker>
    </multi-url-picker>
    </relatedLinks>

    and my Razor script is;

    @foreach (var link in Model.relatedLinks.urlpicker)
    {
    <p>
    <a href="@link.url" @Html.Raw(link.newwindow == "True" ? "target=\"_blank\"" : "")>@link.linktitle</a><br />
    </p>
    }

    This gives me the following error;

    uComponents.DataTypes.MultiUrlPicker.Dto.MultiUrlPickerState does not contain a definition for urlpicker

    What am I doing wrong?

  • stevo 63 posts 106 karma points
    Feb 25, 2013 @ 01:41
    stevo
    101

    Hi,

    at the moment i'm not sure but try this: Model.relatedLinks.Items

     

    @foreach (var link in Model.relatedLinks.Items)  
    {
    <p> <a href="@link.url" @Html.Raw(link.newwindow == "True" ? "target=\"_blank\"" : "")>@link.linktitle</a><br />
    </p>
    }
  • Jon Ivar Nielsen 24 posts 96 karma points
    Feb 25, 2013 @ 09:39
    Jon Ivar Nielsen
    1

    Thanks, Stevo

    "Model.relatedLinks.Items" solved it. I had to rename all properties to get the output I wanted;

    @foreach (var link in Model.relatedLinks.Items)  
      {    
       <p>
          <a class="btn" href="@link.Url" @Html.Raw(link.NewWindow ? "target=\"_blank\"" : "")>@link.Title</a><br /> 
        </p>
      } 

  • stevo 63 posts 106 karma points
    Feb 27, 2013 @ 17:18
    stevo
    0

    you are welcome, i'm glad i could help.

Please Sign in or register to post replies

Write your reply to:

Draft