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, I want to display a below XML in xslt... these images file will be upload by cms user. Please tell me how can i do it. i have do so many tries but not get desire output please explain step my step.. Thanks in advance.
XML is :
<div id="carousel"> <div> <ul class="gallery"> <li><img src="images/img1.jpg" width="693" height="393" alt="image description" /></li> <li><img src="images/img1.jpg" width="693" height="393" alt="image description" /></li> <li><img src="images/img1.jpg" width="693" height="393" alt="image description" /></li> <li><img src="images/img1.jpg" width="693" height="393" alt="image description" /></li> </ul> <ul class="switcher"> <li class="active"><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> </ul> </div> </div>
1. Upload image in media
2. add media picker to document
3. add:
<img src={umbraco.library:GetMedia($currentPage/imageAlias)/umbracoFile}" />
Replace IMAGEALIAS with the media picker alias which you named in the document type.
Follow the Craig step with xslt syntax
<img src={umbraco.library:GetMedia($currentPage/imageAlias,'false')/umbracoFile}" />
Thats right! haha. Oops
.. and don't forget to check if there is an image in the doctype:
<xsl:if test="$currentPage/imageAlias != ''"> <img src={umbraco.library:GetMedia($currentPage/imageAlias,'false')/umbracoFile}" /> </xsl:if>
/Peter
I use this belo code in my xslt but i the image does not display on my desire page. I am new. should i write other code on the top of my xslt
<img src="{umbraco.library:GetMedia($currentPage/thumbNailPicture,'false')/umbracoFile}" />
please help me. how do i get this image.
Hi Md
Try having a look at the examples provided in this wiki entry: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
Hope this helps.
/Jan
Hi Thank you for your quick response. But i am afrade it is not working. My XSLT code given below.
<div class="blogContent"> <h2 id="icon-blog">Blog</h2> <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']"> <xsl:sort select="@createDate" order="descending" /> <xsl:if test="position() <= $maxItems" > <div class="blogPost"> <div class="blogPostPic"> <xsl:value-of select="thumbNailPicture"/> </div> <h2>Phasellus nec magna fermentum</h2> <p id="date"><xsl:value-of select="umbraco.library:LongDate(@createDate)"/> by <xsl:value-of select="@creatorName"/> </p> <p> </p> <a href="{umbraco.library:NiceUrl(@id)}" class="externalLink"> <xsl:value-of select="@nodeName"/> </a> </div> </xsl:if> </xsl:for-each> </div>
everything show but in image result arae it is show like
<img src="/media/3539/pic2.png" width="119" height="119" alt="Pic2"/>
In data type in insert image iby richtext for image .
any other idea. pleas Thank you
Hi,
You should add disable-output-escaping="yes" to your value-of where you render the rich text, in order to have the HTML render properly. Ex:
<xsl:value-of select="thumbNailPicture" disable-output-escaping="yes" />
-Tom
Alhumdullila,Thank you very very much......Tom ............. it working now.
is working on a reply...
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.
Continue discussion
Display Image via XSLT
Hi, I want to display a below XML in xslt... these images file will be upload by cms user. Please tell me how can i do it. i have do so many tries but not get desire output please explain step my step.. Thanks in advance.
XML is :
<div id="carousel">
<div>
<ul class="gallery">
<li><img src="images/img1.jpg" width="693" height="393" alt="image description" /></li>
<li><img src="images/img1.jpg" width="693" height="393" alt="image description" /></li>
<li><img src="images/img1.jpg" width="693" height="393" alt="image description" /></li>
<li><img src="images/img1.jpg" width="693" height="393" alt="image description" /></li>
</ul>
<ul class="switcher">
<li class="active"><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
</ul>
</div>
</div>
1. Upload image in media
2. add media picker to document
3. add:
<img src={umbraco.library:GetMedia($currentPage/imageAlias)/umbracoFile}" />
Replace IMAGEALIAS with the media picker alias which you named in the document type.
Follow the Craig step with xslt syntax
<img src={umbraco.library:GetMedia($currentPage/imageAlias,'false')/umbracoFile}" />
Thats right! haha. Oops
.. and don't forget to check if there is an image in the doctype:
<xsl:if test="$currentPage/imageAlias != ''"> <img src={umbraco.library:GetMedia($currentPage/imageAlias,'false')/umbracoFile}" /> </xsl:if>
/Peter
I use this belo code in my xslt but i the image does not display on my desire page. I am new. should i write other code on the top of my xslt
<img src="{umbraco.library:GetMedia($currentPage/thumbNailPicture,'false')/umbracoFile}" />
please help me. how do i get this image.
Hi Md
Try having a look at the examples provided in this wiki entry: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
Hope this helps.
/Jan
Hi Thank you for your quick response. But i am afrade it is not working. My XSLT code given below.
<div class="blogContent">
<h2 id="icon-blog">Blog</h2>
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:sort select="@createDate" order="descending" />
<xsl:if test="position() <= $maxItems" >
<div class="blogPost">
<div class="blogPostPic">
<xsl:value-of select="thumbNailPicture"/>
</div>
<h2>Phasellus nec magna fermentum</h2>
<p id="date"><xsl:value-of select="umbraco.library:LongDate(@createDate)"/> by <xsl:value-of select="@creatorName"/> </p>
<p>
</p>
<a href="{umbraco.library:NiceUrl(@id)}" class="externalLink">
<xsl:value-of select="@nodeName"/>
</a>
</div>
</xsl:if>
</xsl:for-each>
</div>
everything show but in image result arae it is show like
<img src="/media/3539/pic2.png" width="119" height="119" alt="Pic2"/>
In data type in insert image iby richtext for image .
any other idea. pleas Thank you
Hi,
You should add disable-output-escaping="yes" to your value-of where you render the rich text, in order to have the HTML render properly. Ex:
<xsl:value-of select="thumbNailPicture" disable-output-escaping="yes" />
-Tom
Alhumdullila,Thank you very very much......Tom ............. it working now.
is working on a reply...
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.