Copied to clipboard

Flag this post as spam?

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


  • John Churchley 272 posts 1258 karma points c-trib
    Mar 20, 2015 @ 13:16
    John Churchley
    0

    Getting class value of area in grid

    Hi all,

    I'm creating a custom grid layout view for a grid layout however I've hit the issue of class being a keyword in razor. Any ideas how I can get the JSON value? Tried @@class and @(@class) with no success

    @foreach (var section in grid.sections)
            {
                foreach (var row in section.rows)
                {
                    foreach (var area in row.areas)
                    {<div class="@area.grid.class header-item">
                        @foreach (var control in area.controls)
                        {
                            string imageId = control.value.id.ToString();
                            <img alt="@Umbraco.Media(imageId).Name" src="@Umbraco.Media(imageId).Url?width=350&height=179&mode=crop&anchor=top&slimmage=true" />
                        }
                    </div>
                    }
                }
            }
  • John Churchley 272 posts 1258 karma points c-trib
    Mar 20, 2015 @ 13:23
    John Churchley
    100

    class added through  settings on the grid property editor

     

     

  • John Churchley 272 posts 1258 karma points c-trib
    Mar 23, 2015 @ 18:33
    John Churchley
    0

    Solution was to change the default key value to 'cssclass'

Please Sign in or register to post replies

Write your reply to:

Draft