Copied to clipboard

Flag this post as spam?

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


  • Amigo 245 posts 600 karma points
    Sep 18, 2011 @ 16:32
    Amigo
    0

    link and image in repeater

    How do i get niceurl instead of id in my repeater:
    <a href='<%# Eval("Id") %>' title="">Click here</a>

    and how do i get the src colpleate url of my images:
    <img alt="" src="<%# ((umbraco.interfaces.INode)Container.DataItem).GetProperty("image").Value %>" />

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 18, 2011 @ 16:41
    Fuji Kusaka
    0

    Hi you could try changing

    <a href='<%# Eval("Id") %>' title="">Click here</a>


    to


    <a href="{umbraco.library:NiceUrl(@id)}">Click here</a>

    and for the image you could run a tes like this

    <xsl:if test="$img != ''">
                <img>
                  <xsl:attribute name="src">
                      <xsl:value-of select="news"/>
                  </xsl:attribute>
                      </img>
              </xsl:if>
  • Amigo 245 posts 600 karma points
    Sep 18, 2011 @ 16:51
    Amigo
    0

    ok but im not in a xsl file... im in a repeater itemtemplate i my usercontrol...

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Sep 18, 2011 @ 17:08
    Dan Diplo
    0

    You can still call the method umbraco.library.NiceUrl() from a repeater. So you could do something like:

    <a href='<%# umbraco.library.NiceUrl(Convert.ToInt32(Eval("Id"))) %>' title="">Click here</a>
  • Amigo 245 posts 600 karma points
    Sep 18, 2011 @ 18:06
    Amigo
    0

    og hvordan får jeg GetMedia med på billederne?:
     <img alt="" src="<%# ((umbraco.interfaces.INode)Container.DataItem).GetProperty("image").Value %>" />

Please Sign in or register to post replies

Write your reply to:

Draft