Copied to clipboard

Flag this post as spam?

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


  • Francielle 65 posts 279 karma points
    Jun 23, 2016 @ 13:26
    Francielle
    0

    LeBlender does not recognize Content Picker

    Hi guys, We have been using LeBlender 1.0.8 with Umbraco 7.3.3. We have a grid layout with a bunch of boxes that have a Content Picker to link to the internal pages. This website is being developed for quite some time (almost 12 months now) and we have had the following problem at least 4 times now. The content picker link is no longer recognized in our boxes, they just disappear. We were able to fix this adding the link on the content picker again in each box, but now it is not working. Has anyone faced this issue before?

    This is how we are getting our code:

        var item = Model.Items.ElementAt(0);
    
    var imageUrl = String.IsNullOrEmpty(item.GetValue<string>("backgroundImage"))
        ? ""
        : Umbraco.TypedMedia(item.GetValue<string>("backgroundImage")).Url;
    
    var backgroundColor = String.IsNullOrEmpty(item.GetValue<string>("backgroundColor"))
        ? "#004b85"
        : item.GetValue<string>("backgroundColor");
    
    var link = String.IsNullOrEmpty(item.GetValue<string>("link")) ? "" : item.GetValue<dynamic>("link");
    
    if (!String.IsNullOrEmpty(link.ToString()))
    {
        foreach (var itemLink in link)
        {
            <a href="@itemLink.Url" target="@itemLink.Target" class="block bg-blue" @if(!String.IsNullOrEmpty(@imageUrl)){<text>style="background-image:url(@imageUrl);"</text>}else{<text>style="background-color:@backgroundColor;"</text>}>
                @if (!String.IsNullOrEmpty(@item.GetValue<string>("label")))
                {
                    <div class="block-label">@item.GetValue("label")</div>
                }
                @if (!String.IsNullOrEmpty(@item.GetValue<string>("title")))
                {
                    <h1>@item.GetValue("title")</h1>
                }
                @if (!String.IsNullOrEmpty(@item.GetValue<string>("text")))
                {
                    <h2>@Html.Raw(Umbraco.ReplaceLineBreaksForHtml(item.GetValue("text")))​</h2>
                }
            </a>
        }
    }
    else
    {
        <div class="block bg-blue" @if(!String.IsNullOrEmpty(@imageUrl)){<text>style="background-image:url(@imageUrl);"</text>}else{<text>style="background-color:@backgroundColor;"</text>}>
            @if (!String.IsNullOrEmpty(@item.GetValue<string>("label")))
            {
                <div class="block-label">@item.GetValue("label")</div>
            }
            @if (!String.IsNullOrEmpty(@item.GetValue<string>("title")))
            {
                <h1>@item.GetValue("title")</h1>
            }
            @if (!String.IsNullOrEmpty(@item.GetValue<string>("text")))
            {
                <h2>@Html.Raw(Umbraco.ReplaceLineBreaksForHtml(item.GetValue("text")))​</h2>
            }
        </div>
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft