Copied to clipboard

Flag this post as spam?

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


  • Mohammad Azeem 31 posts 74 karma points
    Jul 09, 2012 @ 17:03
    Mohammad Azeem
    0

    Macro Field Is not Displaying in Content Pages..

    Hi All!
    I Creat a Macro using XSLT , its displays a My Logo Image in Website Home Page:Master but not Displaying in Other Child Pages...
    Reply Fast Plz
    Here is my XSLT code
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

        
        <xsl:variable name="mediaId" select="number($currentPage/logoPicker)" />
        
        
        <xsl:if test="$mediaId > 0">

            <xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" />

            <xsl:if test="$mediaNode/umbracoFile">

                <img src="{$mediaNode/umbracoFile}" height="{umbracoHeight}" width="{umbracoWidth}" />

            </xsl:if>

        </xsl:if>
     

    </xsl:template>

    </xsl:stylesheet>

  • Nigel Wilson 945 posts 2077 karma points
    Jul 09, 2012 @ 21:43
    Nigel Wilson
    0

    Hi Azeem

    I assume you have a property on your home page called logoPicker for the logo.

    The parameter "currentPage" is just that so for the above code to work you would need a logo picker property on all pages. Obviously not a great solution.

    So you should look to use something along the lines of  the following to always grab the logo from the home page.

    $currentPage/ancestor-or-self::* [@level=1]/logoPicker

    Cheers, Nigel

  • Mohammad Azeem 31 posts 74 karma points
    Jul 10, 2012 @ 07:59
    Mohammad Azeem
    0

    Hi Nigal!
    Thanks Dude....
    am very happy for your kind help..
    Cheers , Azeem Ravi

    i would like you contact in future...thanks again

    Skype Name: azeemravi361

  • Nigel Wilson 945 posts 2077 karma points
    Jul 10, 2012 @ 08:39
    Nigel Wilson
    0

    Hey Azeem - good to hear my suggestion helped.

    Please mark my earlier response as a solution so others know it's solved.


    Cheers, Nigel

  • 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.

Please Sign in or register to post replies