Written by Ruben Verborgh Not Version relatedXSLT Example
How to use the handy inline XSLT expressions to customize item output.
Attention: the features described in this document are only available with the latest source code version of Umbraco 4 beta, which is available on CodePlex.
Everyone knows the umbraco:Item element that is used to display a field on your template.
< umbraco:Item runat="server" field="bodyText" />
Of course, it gets a bit trickier if you want to display a media item from a media picker field, because...
< umbraco:Item runat="server" field="mediaItem" />
...actually just displays the node ID. Which is not what you want probably. I think what you want is...
< umbraco:Item runat="server" field="mediaItem" xslt="umbraco.library:GetMedia({0},'true')/@nodeName" />
... which displays the name of the item. Or if it's an image, you might event want this:
< umbraco:Item runat="server" field="mediaItem"
xslt="concat('<img src="', umbraco.library:GetMedia({0},'true')/data[@alias='umbracoFile'], '" />')"
xsltDisableEscaping="true" />
...which displays the image itself.