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
Hi Folks,
How do i access a media section with razor like you would do in XSLT with Type mediaCurrent and get to display each item?
Am trying to get the same results as i would be getting from my current XSLT.
<xsl:variable name="mediaFolder" select="/macro/Docs"/><xsl:if test="$mediaFolder"> <xsl:variable name="mediaItems" select="umbraco.library:GetMedia($mediaFolder/*/@id, true())"/> <xsl:for-each select="$mediaItems/File"> <xsl:variable name="fileSize" select="umbracoBytes"/> <li> <a href="{umbracoFile}" target='_blank'> <xsl:value-of select="@nodeName"/> </a> - <xsl:choose> <xsl:when test="$fileSize >= 1048576"> <xsl:value-of select="round($fileSize div 1048576)"/> MB </xsl:when> <xsl:when test="$fileSize >= 1024"> <xsl:value-of select="round($fileSize div 1024)"/> KB </xsl:when> <xsl:otherwise> <xsl:text>0 Bytes</xsl:text> </xsl:otherwise> </xsl:choose> </li> </xsl:for-each> </xsl:if>
is working on a reply...
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.
Continue discussion
Display Media Item in Razor
Hi Folks,
How do i access a media section with razor like you would do in XSLT with Type mediaCurrent and get to display each item?
Am trying to get the same results as i would be getting from my current XSLT.
is working on a reply...
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.