Copied to clipboard

Flag this post as spam?

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


  • Bert Hoorne 15 posts 55 karma points
    May 03, 2015 @ 21:45
    Bert Hoorne
    0

    Related links - Grid editor

    Hi,

    When I try to use the Related Links datatype for my leblender editor, I cannot select an internal link.
    Also the layout for this data-type is somewhat messed up.

    Thanks for the great tool though!
    Regards
    Bert

  • Mehul Gajjar 48 posts 172 karma points
    May 04, 2015 @ 07:28
    Mehul Gajjar
    0

    Hi Bert,

    can you please give some more detail so will help to fix your issue.

    Regards

    Mehul Gajjar.

  • Antoine 176 posts 1494 karma points
    May 04, 2015 @ 09:18
    Antoine
    100

    Hi Bert,

    Related Links datatype is one of the internal Umbraco datatypes that isn't adapted to be placed within the right side bar. Its markup isn't adaptive, so impossible to use here.

    You can use Multi Url Picker instead, it's a great package and it fits perfectly within the right side bar.

  • Ben McKean 272 posts 549 karma points
    May 15, 2015 @ 12:04
    Ben McKean
    0

    Hi

    I've tried implementing this today but when I render in the grid I get an error, shown below. Should it be able to be rendered in the Grid? Is this related to the "Grid editor alias" field? If so what should it be?

    Thanks

    Something went wrong with this editor, below is the data stored:

    ....

  • Ben McKean 272 posts 549 karma points
    May 15, 2015 @ 12:14
    Ben McKean
    0

    Just tried deleting and adding again and now get:

    The view '/views/partials/grid/editors/Multiurlpicker.cshtml' or its master was not found or no view engine supports the searched locations. The following locations were searched: /views/partials/grid/editors/Multiurlpicker

  • Ben McKean 272 posts 549 karma points
    May 15, 2015 @ 14:31
    Ben McKean
    1

    I managed to get this working. I needed to create an editor for the MultiUrlPicker in the location above. It doesn't look and behave exactly as the Multi URL picker does but it shows the related links and outputs how I want it to on the website.

    Here is my code

    @using RJP.MultiUrlPicker.Models

    @inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel>

    @if(Model.Items.Any())

    {

        var links = Model.Items.First().GetValue<MultiUrls>("multiURLPicker");

        if (links.Any())

          {

            <ul>

              @foreach (var link in links)

              {

                var url = link.Url;

                // resolve the url if the link is internal

                if (link.Id != null) {

                url = Umbraco.NiceUrl((int)link.Id);

                }

                  <li>

                      <a href="@url" title="@link.Name" target="@link.Target">@link.Name</a>

                  </li>            

              }

            </ul>

          }

    }

     

     

  • Antoine 176 posts 1494 karma points
    May 18, 2015 @ 10:22
    Antoine
    1

    Looks great, thanks for your exemple.

    FYI: the first issue you had, was because you probably changed the name of the editor and the doesnt didn't able to find the old one.

    The second was because the partial view for the editor was missing.

    Good Job :)

Please Sign in or register to post replies

Write your reply to:

Draft