Copied to clipboard

Flag this post as spam?

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


  • sahadev 18 posts 145 karma points
    Jul 03, 2017 @ 13:09
    sahadev
    0

    Convert MVC razor code into xslt code

    Hi

    i'm new in xslt kind of things please help me convert below code into xslt format

      @inherits Umbraco.Web.Macros.PartialViewMacroPage
    @{
        //get all children of type 'slide_item'
        var slides = @CurrentPage.Children.Where("DocumentTypeAlias == \"slide_item\"");       
    }
    <div class="slider">
        @foreach (var slide in @slides) {
          //Fallback: Ignore slide when no image was uploaded,
          //else the slide would cause a server error.
          if(@slide.image != null) {
            var image = Umbraco.Media(@slide.image);
            <div class="slide">
                <img alt="@slide.name" src="@image.Url">
            </div>
          }
        }
    </div>
    
  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Jul 03, 2017 @ 14:10
    Alex Skrypnyk
    0

    Hi Sahadev

    Why do you need to convert this pretty code to XSLT?

    Alex

  • sahadev 18 posts 145 karma points
    Jul 04, 2017 @ 04:41
    sahadev
    0

    Hi Alex ,

    First of all thanks for your response

    i want to convert it because i'm using Umbraco 6.1.6 with webforms so i think razor not supported in it that's why i want to convert in into xlst

    thanks

    sahadev

  • sahadev 18 posts 145 karma points
    Jul 04, 2017 @ 08:20
    sahadev
    100

    its working in umbraco 6 also

Please Sign in or register to post replies

Write your reply to:

Draft