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 " "> ]> <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 ">
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.
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 " "> ]>
<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>
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
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
Hey Azeem - good to hear my suggestion helped.
Please mark my earlier response as a solution so others know it's solved.
Cheers, Nigel
is working on a reply...