Copied to clipboard

Flag this post as spam?

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


  • Martin 278 posts 662 karma points
    Apr 28, 2015 @ 12:22
    Martin
    0

    Get Prevalue

    Hi, Im looking for some help with a dropdown list within LeBlender.

    I can get the dropdown id number, but I am struggling to get the prevalue. Ive tried changing GetValue to GetPreValue, with no joy.

    Any help would be grateful.

    @inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel>
    
    @if (Model.Items.Any())
    {
        <ul class="highlight-tiles">
            @foreach (var item in Model.Items)
            {
    
                var highlight = Model.Items.ElementAt(0);
    
                var title = highlight.GetValue<string>("title");    
                var summary = highlight.GetValue<string>("summary");
                var color = highlight.GetValue<string>("dropdown");
    
                <li class="highlight">
                    <div>
                        @if (@item.GetValue("dropdown") != "")
                        {
                             <p>@item.GetValue("dropdown")</p> 
                        }
                        @if (@item.GetValue("title") != "")
                        {
                            <h3 class="title">@item.GetValue("title")</h3>
                        }
                        @if (@item.GetValue("summary") != "")
                        {
                            <p class="summary">@Html.Raw(item.GetValue("summary"))</p>
                        }
    
                    </div>
                </li>
            }
        </ul>
    }   
    
  • Antoine 176 posts 1494 karma points
    May 03, 2015 @ 11:32
    Antoine
    1

    Hi Martin, 

    The same problem occurs with Archetype package, Umbarco dropdown datatype return ids, not values, so you have to get all pre-values first (don't forget to cache it)

    More info:

    https://our.umbraco.org/projects/backoffice-extensions/archetype/sound-off!/49659-Getting-value-id-instead-of-values%28text%29-from-dropdown#comment178790

Please Sign in or register to post replies

Write your reply to:

Draft