Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
This is a Razor script, and I like to make it into Xslt script
if (@strfyld == "column1x1"){strtw = "columnb1";} if (@strfyld == "column1x2"){strtw = "columnb2";} if (@strfyld == "column2x1"){strtw = "columnb1 columnh2"} if (@strfyld == "column2x2"){strtw = "columnb2 columnh2"} if (@strfyld == "column2x3"){strtw = "columnb3 columnh2"} if (@strfyld == "column2x4"){strtw = "columnb4 columnh2"}
<div class="column @strtw paddingrb16"><div class="transition @strfyld"><img class="rundkanter" src="@strdamp"/></div><div class="textoverteasers @strtw"><div class="padding5"><span class="sortlilleoverskrift">@stroverskrift</span><br/><div class="padding10"><span class="teasertext">@strtekst</span></div></div></div></div></a>
Hi Brian,
Here's an example of how to convert the Razor over to XSLT:
<xsl:variable name="strfyld" select="'not sure where you are getting this value from?'" /> <xsl:variable name="strtw"> <xsl:choose> <xsl:when test="$strfyld = 'column1x1'">columnb1</xsl:when> <xsl:when test="$strfyld = 'column1x2'">columnb2</xsl:when> <xsl:when test="$strfyld = 'column2x1'">columnb1 columnh2</xsl:when> <xsl:when test="$strfyld = 'column2x2'">columnb2 columnh2</xsl:when> <xsl:when test="$strfyld = 'column2x3'">columnb3 columnh2</xsl:when> <xsl:when test="$strfyld = 'column2x4'">columnb4 columnh2</xsl:when> </xsl:choose> </xsl:variable> <div class="column {$strtw} paddingrb16"> <div class="transition {$strfyld}"> <img class="rundkanter" src="{$strdamp}"/> </div> <div class="textoverteasers {$strtw}"> <div class="padding5"> <span class="sortlilleoverskrift"> <xsl:value-of select="$stroverskrift"/> </span> <br/> <div class="padding10"> <span class="teasertext"> <xsl:value-of select="$strtekst"/> </span> </div> </div> </div> </div>
Obviously from your original code snippet, I'm not sure where the values come from for the variables: "strfyld", "strdamp", "stroverskrift" and "strtekst" - you'll need to populate those.
Cheers, Lee.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
razor to xslt
This is a Razor script, and I like to make it into Xslt script
if (@strfyld == "column1x1"){strtw = "columnb1";}
if (@strfyld == "column1x2"){strtw = "columnb2";}
if (@strfyld == "column2x1"){strtw = "columnb1 columnh2"}
if (@strfyld == "column2x2"){strtw = "columnb2 columnh2"}
if (@strfyld == "column2x3"){strtw = "columnb3 columnh2"}
if (@strfyld == "column2x4"){strtw = "columnb4 columnh2"}
<div class="column @strtw paddingrb16"><div class="transition @strfyld"><img class="rundkanter" src="@strdamp"/></div><div class="textoverteasers @strtw"><div class="padding5"><span class="sortlilleoverskrift">@stroverskrift</span><br/><div class="padding10"><span class="teasertext">@strtekst</span></div></div></div></div></a>
Hi Brian,
Here's an example of how to convert the Razor over to XSLT:
Obviously from your original code snippet, I'm not sure where the values come from for the variables: "strfyld", "strdamp", "stroverskrift" and "strtekst" - you'll need to populate those.
Cheers, Lee.
is working on a reply...