Copied to clipboard

Flag this post as spam?

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


  • Bilal Isa 60 posts 76 karma points
    Jan 31, 2009 @ 21:25
    Bilal Isa
    0

    Meta data

    Hi experts

    I'm trying to make an umbraco macro that pulls meta data from my content pages dynamically.

    It looks like this:


    ]>

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    xmlns:softpilar.library="urn:softpilar.library"
    exclude-result-prefixes="msxml umbraco.library softpilar.library">


















    However I cant get it to work when I place the macro in my template / master page. The meta data display empty in my content pages:






    Help is very appreciated. Thanks in advance.

  • Daniel Lindstrom 454 posts 271 karma points
    Feb 01, 2009 @ 12:36
    Daniel Lindstrom
    0

    Hi!
    The one thing I noticed with your code is that you do not have ' around the alias names. Try that, like this:


    instead of:


    Also, you might consider using xsl:choose instead of multiple xsl:if. The english meta data would be placed in the xsl:otherwise option. See here: http://www.w3schools.com/Xsl/el_choose.asp

  • Bilal Isa 60 posts 76 karma points
    Feb 01, 2009 @ 14:46
    Bilal Isa
    0

    Hi Daniel

    Thank you for the quick reply and for the solution to my problem. I'm still a newbie in XSLT, only started using it in connection with Umbraco :)
    and thanks for recommending xsl:choose instead of xsl:if, it really made my XSLT much simpler.

Please Sign in or register to post replies

Write your reply to:

Draft