Copied to clipboard

Flag this post as spam?

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


  • MaaNe 1 post 21 karma points
    May 19, 2011 @ 13:36
    MaaNe
    0

    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>

     

  • Mentor Digital 19 posts 135 karma points
    May 19, 2011 @ 18:36
    Mentor Digital
    0

    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.

  • praveity 100 posts 125 karma points
    May 20, 2011 @ 12:46
    praveity
    0

    Follow the Craig step with xslt syntax

    <img src={umbraco.library:GetMedia($currentPage/imageAlias,'false')/umbracoFile}" />
  • Mentor Digital 19 posts 135 karma points
    May 20, 2011 @ 12:49
    Mentor Digital
    0

    Thats right! haha. Oops

     

  • Peter Holmsgaard 69 posts 106 karma points
    May 22, 2011 @ 10:52
    Peter Holmsgaard
    0

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

  • Md Johirul Islam 37 posts 57 karma points
    Oct 16, 2011 @ 00:24
    Md Johirul Islam
    0

    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. 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Oct 16, 2011 @ 00:43
    Jan Skovgaard
    0

    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

  • Md Johirul Islam 37 posts 57 karma points
    Oct 16, 2011 @ 01:11
    Md Johirul Islam
    0

    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() &lt;= $maxItems" >
        <div class="blogPost">
          <div class="blogPostPic">
          <xsl:value-of select="thumbNailPicture"/>
           </div>
                <h2>Phasellus nec magna fermentum</h2>
                <id="date"><xsl:value-of select="umbraco.library:LongDate(@createDate)"/>  by <xsl:value-of select="@creatorName"/> </p>
          <p
          </p>
          <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

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Oct 16, 2011 @ 04:04
    Tom Fulton
    1

    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

  • Md Johirul Islam 37 posts 57 karma points
    Oct 16, 2011 @ 07:51
    Md Johirul Islam
    0

    Alhumdullila,Thank you very very much......Tom     ............. it working now.  

  • 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