Copied to clipboard

Flag this post as spam?

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


  • nelson 6 posts 26 karma points
    Jul 13, 2012 @ 02:16
    nelson
    0

    Show Photo

    Hi,

    I want to display an image by using a cshtml file.
    I have a property created with the alias "foto" but i don't know how to put that property here:

    <img src="" width="137" height="103" alt="xp" />

    This is the complete code that contains the cshtml file.

    @{   
            @* -- Setup a counter variable for position -- *@
            var position = 1;
        }

        @* -- List children pages from the current page (aka Model) -- *@
        @foreach (var page in @Model.Children.Where("umbracoNaviHide != true"))
        {
         
          <div class="noticia">
            <div class="n-left">       
               <img src="" width="137" height="103" alt="xp" />
            </div>
            <div class="n-right">
                    <h2>@page.Name</h2>
                    <p><strong>
                       
                        @page.fecha.ToString("dd.MM.yyyy");
                   
                    </strong></p>
                      @{
                    var texto         = @page.texto.ToString();
                    var textoNoHtml   = umbraco.library.StripHtml(texto);
                    var textoTrunc    = umbraco.library.TruncateString(textoNoHtml, 100, "...");
                }

                <p>
                    @textoTrunc
                </p>
                      <div class="read-more2"><a href="@page.Url">leer mรกs...</a></div>          
                  </div>                
                   <img src="images/not-divider.png" alt="divider" class="divider2"/>                         
            </div>
                            
            @* -- After every 3rd item insert a <br/> -- *@
            if (position % 3 == 0)
            {
                <br class="clearBoth"/>
            }
            
            @* -- Increase the position counter by 1 -- *@
            position++;

        }

    thanks for the answer.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies