Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    May 14, 2012 @ 10:37
    Anthony Candaele
    0

    how to check if documenttype has 'damp' image property

    Hi,

    Currently I'm struggling to check if a documenttype (member) has a 'damp' image property:

    @{

      var membersToList = @Model.Children.Where("Visible");

        <table>

        @foreach (var memberGroup in membersToList.InGroupsOf(3))

          {

           <tr>

           @foreach (dynamic member in memberGroup)

             {

              <td style="padding:10px;">

                  @{

                      if(member.HasValue("memberImage"))

                      {

                          var image = member.memberImage.mediaItem.MemberImage.umbracoFile;

                      }

                   }

                @if (image != null)

                {

                    <img src="/imageGen.ashx?image=@image&amp;width=150" style="margin-bottom:10px;"/><br />

     

                }

                else

                {

                    <img src="/imageGen.ashx?image=/media/1591/mystery-person.jpg&amp;width=150" style="margin-bottom:10px;"/><br />

                }           

                @(member.memberFirstName + " " + member.memberLastName) 

              </td>

             }

           </tr>

          }

            </table>

      }

Please Sign in or register to post replies

Write your reply to:

Draft