Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
Using the following XSLT as a macro e.t.c (it is a basic image slider)
No errors but it doesnt show images just the red x (no image) type thingy...
I have a slideshow and slide under the root... stratching my head a plenty.. any tips appreciated ....
XSLT:
<?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="nodeIds" select="umbraco.library:Split($currentPage/slideshow,',')" />
<div id="slideshow">
<ul>
<xsl:for-each select="$nodeIds/value">
<li class="rotating-panel fc">
<xsl:if test="position() > 1">
<xsl:attribute name="style">display:none;</xsl:attribute>
</xsl:if>
<xsl:variable name="slide" select="umbraco.library:GetXmlNodeById(current()/.)"/>
<img class="fl" alt="{$slide/@nodeName}" src="{$slide/mainImage}"/>
<div class="">
<xsl:value-of select="$slide/bodyText" disable-output-escaping="yes"/>
</div>
</li>
</xsl:for-each>
</ul>
<ul id="slidePager">
<li>
<a href="?position={position()}">
<xsl:if test="position() = 1">
<xsl:attribute name="class">selected</xsl:attribute>
<xsl:value-of select="position()"/>
</a>
</xsl:template>
</xsl:stylesheet>
Hi Matt
What does the rendered image path look like?
And have you checked that the media nodes have been mapped to an image file?
/Jan
Hi ,
Thanks for the reply Jan.
It shows the img tag as completely empty in the renderd html.
I have a folder of doc type slideshow and within that a doctype of slide which has an image mapped to it.
Very confused. Any further advise appreciated. You can see the image display prob at http://www.refreshme.org.uk
Thanks
What XML do you get returned if you write this?
<textarea><xsl:copy-of select="$nodeIds" /> </textarea>
Looking forward to hearing from you.
Thank you once again.
Do you mean for me to add that to the page that tries to embed the macro e.t.c
Cheers
I tried adding the code to the html of the homepage but it displays as empty.... no errors
I mean you should add the above snippet in the macro you're trying to get to render the image.
Seems like you're not getting any data returned...
Do you get any id's by simply writing <xsl:value-of select="$currentPage/slideshow" /> ?
If not what is the context of the page you're currently on? How does it know what image to display?
Hey Matt,
What value does "slideshow" have in your /App_Data/umbraco.config have?
If you're using the MultiNodeTreePicker then this has CSV or XML settings, your code needs CSV
Rich
Actually Matt, your logic is a little wrong here, where did you get that XSLT from?
You need (in XSLT or Razor) to traverse to the SlideShow node and then loop through the child fields.
Make sense?
Hi, Thanks for replies and sorry for my late reply (got the man flu)
Anyway it is the xslt taken from the Basic Website StarterKit by Chris Koiak.
From what I can see I have it set up in my site exactly as it appears to be in his site but no joy...
Could you elaborate a little on what you mean by traverse to the slideshow then loop through child fields e.t.c
Appreciate all your help.. I am such a noob but starting to get to grips with it now a bit lol
Any hints appreciated !
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
XSLT Query !!!
Hi all,
Using the following XSLT as a macro e.t.c (it is a basic image slider)
No errors but it doesnt show images just the red x (no image) type thingy...
I have a slideshow and slide under the root... stratching my head a plenty.. any tips appreciated ....
XSLT:
<?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="nodeIds" select="umbraco.library:Split($currentPage/slideshow,',')" />
<div id="slideshow">
<ul>
<xsl:for-each select="$nodeIds/value">
<li class="rotating-panel fc">
<xsl:if test="position() > 1">
<xsl:attribute name="style">display:none;</xsl:attribute>
</xsl:if>
<xsl:variable name="slide" select="umbraco.library:GetXmlNodeById(current()/.)"/>
<img class="fl" alt="{$slide/@nodeName}" src="{$slide/mainImage}"/>
<div class="">
<xsl:value-of select="$slide/bodyText" disable-output-escaping="yes"/>
</div>
</li>
</xsl:for-each>
</ul>
<ul id="slidePager">
<xsl:for-each select="$nodeIds/value">
<li>
<a href="?position={position()}">
<xsl:if test="position() = 1">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="position()"/>
</a>
</li>
</xsl:for-each>
</ul>
</div>
</xsl:template>
</xsl:stylesheet>
Hi Matt
What does the rendered image path look like?
And have you checked that the media nodes have been mapped to an image file?
/Jan
Hi ,
Thanks for the reply Jan.
It shows the img tag as completely empty in the renderd html.
I have a folder of doc type slideshow and within that a doctype of slide which has an image mapped to it.
Very confused. Any further advise appreciated. You can see the image display prob at http://www.refreshme.org.uk
Thanks
Hi Matt
What XML do you get returned if you write this?
<textarea>
<xsl:copy-of select="$nodeIds" />
</textarea>
Looking forward to hearing from you.
/Jan
Thank you once again.
Do you mean for me to add that to the page that tries to embed the macro e.t.c
Cheers
I tried adding the code to the html of the homepage but it displays as empty.... no errors
Hi Matt
I mean you should add the above snippet in the macro you're trying to get to render the image.
Seems like you're not getting any data returned...
Do you get any id's by simply writing <xsl:value-of select="$currentPage/slideshow" /> ?
If not what is the context of the page you're currently on? How does it know what image to display?
/Jan
Hey Matt,
What value does "slideshow" have in your /App_Data/umbraco.config have?
If you're using the MultiNodeTreePicker then this has CSV or XML settings, your code needs CSV
Rich
Actually Matt, your logic is a little wrong here, where did you get that XSLT from?
You need (in XSLT or Razor) to traverse to the SlideShow node and then loop through the child fields.
Make sense?
Rich
Hi, Thanks for replies and sorry for my late reply (got the man flu)
Anyway it is the xslt taken from the Basic Website StarterKit by Chris Koiak.
From what I can see I have it set up in my site exactly as it appears to be in his site but no joy...
Could you elaborate a little on what you mean by traverse to the slideshow then loop through child fields e.t.c
Appreciate all your help.. I am such a noob but starting to get to grips with it now a bit lol
Any hints appreciated !
Thanks
is working on a reply...