Copied to clipboard

Flag this post as spam?

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


  • Sam 63 posts 126 karma points
    Nov 26, 2014 @ 05:52
    Sam
    0

    Converting an old XSLT code to RAzor

    Hi all

    I have an old xslt code that i've written some days back now - I want to convert it to razor - and need some help on this:

     

    Heres the code:

    <xsl:for-each select="$currentPage">

     <div class="fb-like-cn">

         <a>

              <xsl:attribute name="href">

                http://www.facebook.com/sharer.php?s=100&amp;p[title]=<xsl:value-of select="newsTitle"/>&amp;p[url]=http://www.fireworks.mu<xsl:value-of select="umbraco.library:NiceUrl(@id)"/>&amp;p[images][0]=&amp;p[summary]=<xsl:value-of select="newsDescription"/>

               </xsl:attribute>

          <xsl:attribute name="target">blank</xsl:attribute>

          <img src="/images/facebookshare.jpg" width="60" height="18" alt="Facebook share" border="0" />

        </a>      

      </div>

    </xsl:for-each>

    It takes custom umbraco field on a news page and share on facebook - also i am gettin problem to retrieve an uploaded image with the xslt code - can it be resolved in razor?

    Thks.

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 26, 2014 @ 06:05
    Jan Skovgaard
    0

    Hi Sam

    What version of Umbraco are you using? Just asking because it matters in regards to how the Razor should be written :)

    /Jan

  • Sam 63 posts 126 karma points
    Nov 26, 2014 @ 06:32
    Sam
    0

    Am on umbraco v 4.11.8

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Nov 26, 2014 @ 12:15
    Jeroen Breuer
    0

    In that case it's best to use Partial View Macro Files because they can be added as macro's on your masterpage templates (assuming you're still using webforms). Read this for more info: http://our.umbraco.org/forum/developers/razor/44664-Confused-over-when-DynamicNodeList-is-returned?p=0#comment160691

     

    Some documentation: http://our.umbraco.org/documentation/Reference/Mvc/querying

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft