Copied to clipboard

Flag this post as spam?

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


  • Kaushik 1 post 71 karma points
    Dec 28, 2021 @ 07:02
    Kaushik
    0

    Render Nested Element by order

    I have testimonial from various clients. now i want to so last added testimonial first. But i could not know, how can i order by it. I have created nested content (as element).

    My partial code is as following. I could not get my element under Modal.Contnet.Childern. It will be shows as separate entities.

    var AllSlider = Model.Content.Value<>

    Please can you assist or provide the details about the way to achieve this?

    @inherits Umbraco.Web.Macros.PartialViewMacroPage

    @using Umbraco.Web.Models

    @{

    var AllSlider = Model.Content.Value<>

    }

    @if (AllSlider != null) {

    foreach (IPublishedElement slide in AllSlider.Where(x => x.IsVisible()))
    {
    
        string title = slide.Value<string>("slideTitle");
        string subtitle = slide.Value<string>("slideSubtitle");
    
        var img = slide.Value<MediaWithCrops>("slideImage");
        var link = slide.Value<Link>("slideLink");
        var linkVideo = slide.Value<Link>("slideVideo");
        var videoLink = "";
        if (linkVideo != null)
        {
            videoLink = @linkVideo.Url;
        }
       // my html code here.
    

    } }

Please Sign in or register to post replies

Write your reply to:

Draft