Copied to clipboard

Flag this post as spam?

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


  • Vincent Ashby-Smith 67 posts 196 karma points
    Jan 21, 2010 @ 16:35
    Vincent Ashby-Smith
    0

    Title tag in inline xslt

    Hi all, i have the following piece of inline xslt, to create a link to a flash video, however i'm not sure how to set the title tag. I have an umbraco field called flashVideoHeaderText where i want to specificy the title text. Any ideas?

    <p><umbraco:Item runat="server" field="flashVideo" xslt="concat('&lt;a href=&quot;', umbraco.library:GetMedia({0},'true')/data[@alias='umbracoFile'], '&quot; class=&quot;flash&quot; title=&quot; &quot;/&gt;')" xsltDisableEscaping="true" /><umbraco:Item field="caseStudyFlashVideoHeaderText" runat="server"></umbraco:Item></a></p>

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 22, 2010 @ 10:32
    Douglas Robar
    0

    Inline xslt in an umbraco:Item is meant for simple use cases. It only passes in the field="" parameter. You also have access to the $currentPage parameter. As long as the properties you want to display can be accessed in one of those two ways you're all set.

    However... what you're trying to do here is a bit involved and inline xslt is not going to make it clearer. Personally, I'd use an xslt macro instead... it will let you use white space, comments, and will be easier live with in the long-term.

    In your example, you want to make an <a> tag with an href and a value. You've got the start of the <a tag, the href, and the title. Then you need to insert the value and close the anchor with an </a>. You've cobbled together everything except the title itself.

    It looks as though you have a property on the current page called "caseStudyFlashVideoHeaderText". If that's the case your title= would be:

    title=&quot;$currentPage/data[@alias='caseStudyFlashVideoHeaderText']&guot;

    Hope that helps, though again I'd recommend a macro for clarity and future maintenance.

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft