Copied to clipboard

Flag this post as spam?

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


  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 13:40
    savantKing99
    0

    Showing image

    I have this:

     


    ]>
        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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">









         

    •        
                 
                 

       


             

       

         
             
         






     

     

    But I dont see the image, but only a number. And If I choose for the property: Upload, I see the link to it?? But not the image itself - /media/1003/_mg_1080-copy.jpg

     

    THX

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 14:09
    Alex Skrypnyk
    0

    Hi,

    Are your image in media ?

    we don't see your code example ) please fix your topic )

    THanks

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 14:24
    savantKing99
    0

    I am new here, but how to add xslt code in this post?

    And I have just a document type Prents - with the properties: Title, Description and an image(Type: Upload) and then by content I can fill in: title, description and browse image - I do that ans safe/publish the item. But then I only see the url of the image.

    I try again: this is my xslt:

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <li>
           
                <xsl:value-of select="@nodeName"/>
                <p><xsl:value-of select="prentOmschrijving"/></p>
            <p><xsl:value-of select="prentPlaatje1"/></p>   
            <p><xsl:value-of select="uploadImage  ['$mediaItem/data']"/></p>
        </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

    </xsl:stylesheet>

     

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 14:31
    Alex Skrypnyk
    0

    You should to insert your image path into the 'img' html tag.

    Example:

    <img src="{$url}" width="{$width}" height="{$height}" alt="{$alt}" />
  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 14:36
    savantKing99
    0

    I dont understand.

    Where to put that line?

    in the xslt file, like this?

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <li>
           
                <xsl:value-of select="@nodeName"/>
                <p><xsl:value-of select="prentOmschrijving"/></p>
            <p><xsl:value-of select="prentPlaatje1"/></p>   
            <p><xsl:value-of select="uploadImage  ['$mediaItem/data']"/></p>
            <img src="{$url}" width="{$width}" height="{$height}" alt="{$alt}" />
           
        </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

    </xsl:stylesheet>

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 14:39
    savantKing99
    0

    It looks now like this:

    Dit zijn onze prenten

    • Eerste prent

      Mooie prent1

      1108

      /media/1004/_mg_1091-copy.jpg

    • Prent2

      Mooie prent2

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 14:45
    Alex Skrypnyk
    0
    <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" /> <xsl:if test="$media"> <xsl:variable name="url" select="$media/umbracoFile" /> <xsl:variable name="width" select="$media/umbracoWidth" /> <xsl:variable name="height" select="$media/umbracoHeight" /> <xsl:variable name="alt" select="$item/header"/> <img src="{$url}" width="{$width}" height="{$height}" alt="{$alt}" /> </xsl:if>
  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 14:50
    savantKing99
    0

    oke, thx.

    But where to put that line? In the xslt file?

    like this?

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <li>
           
                <xsl:value-of select="@nodeName"/>
                <p><xsl:value-of select="prentOmschrijving"/></p>
            <p><xsl:value-of select="prentPlaatje1"/></p>   
            <p><xsl:value-of select="uploadImage  ['$mediaItem/data']"/></p>
           
            <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" /> <xsl:if test="$media"> <xsl:variable name="url" select="$media/umbracoFile" /> <xsl:variable name="width" select="$media/umbracoWidth" /> <xsl:variable name="height" select="$media/umbracoHeight" /> <xsl:variable name="alt" select="$item/header"/> <img src="{$url}" width="{$width}" height="{$height}" alt="{$alt}" /> </xsl:if>

           
           
            <br/>
       
           
        </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

    </xsl:stylesheet>

     

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 14:52
    Alex Skrypnyk
    0

    Yes, in the place for image.

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 14:52
    Alex Skrypnyk
    0

    Does it work ? 

     

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 14:55
    savantKing99
    0

    oh, but that doesn work.

     

    If I do it like this:

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <li>
           
                <xsl:value-of select="@nodeName"/>
                <p><xsl:value-of select="prentOmschrijving"/></p>       
            <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" /> <xsl:if test="$media"> <xsl:variable name="url" select="$media/umbracoFile" /> <xsl:variable name="width" select="$media/umbracoWidth" /> <xsl:variable name="height" select="$media/umbracoHeight" /> <xsl:variable name="alt" select="$item/header"/> <img src="{$url}" width="{$width}" height="{$height}" alt="{$alt}" /> </xsl:if>       
           
            <br/>      
        </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

    </xsl:stylesheet>

     

    I get this errors:

     

    Error occuredError in XSLT at line 23, char 28
    21:       <xsl:value-of select="@nodeName"/>
    22:       <p><xsl:value-of select="prentOmschrijving"/></p>
    23: >>>   <xsl:variable name="media"select="umbraco.library:GetMedia(./prentPlaatje1, 0)" /> <xsl:if test="$media"> <xsl:variable name="url" select="$media/umbracoFile" /> <xsl:variable name="width" select="$media/umbracoWidth" /> <xsl:variable name="height" select="$media/umbracoHeight" /> <xsl:variable name="alt" select="$item/header"/> <img src="{$url}" width="{$width}" height="{$height}" alt="{$alt}" /> </xsl:if> <<<
    24:      
    25:      

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 14:57
    Alex Skrypnyk
    0

              <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" />

              <xsl:if test="$media">

                <xsl:variable name="url" select="$media/umbracoFile" />

                <xsl:variable name="width" select="$media/umbracoWidth" />

                <xsl:variable name="height" select="$media/umbracoHeight" />

                <img src="{$url}" width="{$width}" height="{$height}" alt="" />

              </xsl:if>

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 15:02
    savantKing99
    0

    I am sorry to say, but I have it now like this:

     

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">
        

        

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <li>
           
                <xsl:value-of select="@nodeName"/>
                <p><xsl:value-of select="prentOmschrijving"/></p>
            <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" />

              <xsl:if test="$media">

                <xsl:variable name="url" select="$media/umbracoFile" />

                <xsl:variable name="width" select="$media/umbracoWidth" />

                <xsl:variable name="height" select="$media/umbracoHeight" />

                <img src="{$url}" width="{$width}" height="{$height}" alt="" />

              </xsl:if>
        
           
           
           

           
           
            <br/>
        
           
        </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

    </xsl:stylesheet>

    But then I get this errors:

    Error occured

    System.OverflowException: Value was either too large or too small for an Int32.
    at System.Convert.ToInt32(Double value)
    at System.Double.System.IConvertible.ToInt32(IFormatProvider provider)
    at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
    at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 15:06
    savantKing99
    0

    And what is the difference between the properties: Media Picker and Upload. Because by Content, I dont see the image in the textEditor when I select an image. But by Upload I see the Image in the TextEditor.

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 15:08
    Alex Skrypnyk
    0

    Media picker creates node in MEdia section, my code is for media picker.

    Upload picker uploads images in the simplier way and store only path to it.

     

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 15:15
    savantKing99
    0

    oke, but this line: <xsl:value-of select="prentPlaatje1"/> is of type: Media Picker.

    But can u show where to put ur code in the file?

    because this doesnt work:

     

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">
       

       

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <li>
           
                <xsl:value-of select="@nodeName"/>
                <p><xsl:value-of select="prentOmschrijving"/></p>


      <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" />

              <xsl:if test="$media">
                <xsl:variable name="url" select="$media/umbracoFile" />
                <xsl:variable name="width" select="$media/umbracoWidth" />
                <xsl:variable name="height" select="$media/umbracoHeight" />

                <img src="{$url}" width="{$width}" height="{$height}" alt="" />
              </xsl:if>

           


           
           
           

           
           
            <br/>
       
           
        </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

    </xsl:stylesheet>

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 15:32
    savantKing99
    0

    I still see this:

    • Eerste prent

      Mooie prent1

      /media/1004/_mg_1091-copy.jpg
    • Prent2

      Mooie prent2

      1108/media/1006/_mg_1126-copy.jpg
    • prent3

      Dit is een mooie prent.

      /media/1005/_mg_1111-copy.jpg
  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 15:37
    Alex Skrypnyk
    0

    it's really strange, why img tag doesn't render

    it's result of your last code ?

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 15:40
    savantKing99
    0

    But If I put this line, like this:

     

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

       

       

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <li>
           
                <xsl:value-of select="@nodeName"/>
                <p><xsl:value-of select="prentOmschrijving"/></p>
               <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" />
             
           
            Error occured

    System.OverflowException: Value was either too large or too small for an Int32.
    at System.Convert.ToInt32(Double value)
    at System.Double.System.IConvertible.ToInt32(IFormatProvider provider)
    at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
    at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)


           
           

           
           
            <br/>
       
           
        </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

    </xsl:stylesheet>

     

    Under this: <!-- The fun starts here -->

    I already get errors:

     

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 15:47
    Alex Skrypnyk
    0

     <xsl:value-of select="@nodeName"/>
     <p><xsl:value-of select="prentOmschrijving"/></p>

    You need to specify node from you trying to fetch properties

    In the loop you can to use '.', that means current node:

    <xsl:value-of select="./@nodeName"/>
    <p><xsl:value-of select="./prentOmschrijving"/></p>

     

    THanks

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 15:50
    savantKing99
    0

    ? And then for the image? That is for description. that works. But the image is now showing.

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 15:54
    Alex Skrypnyk
    0

    if you want to fetch Media image, use this code : 

      <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" />

              <xsl:if test="$media">
                <xsl:variable name="url" select="$media/umbracoFile" />
                <xsl:variable name="width" select="$media/umbracoWidth" />
                <xsl:variable name="height" select="$media/umbracoHeight" />

                <img src="{$url}" width="{$width}" height="{$height}" alt="" />
              </xsl:if>

     are you sure that prentPlaatje1 is alias of your field ? 

     if you want to use file upload image, example:

                <img src="{./hereInsertYourFileUploadFieldAlias}"  />

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 16:02
    savantKing99
    0

    Oke, thx.

     

    But can you put it in the hole file. I just created by xslt folder a new xslt file.

    THX

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 16:04
    Alex Skrypnyk
    0

    i can to fix your xslt in your site ) what do you think ?

     

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 16:07
    savantKing99
    0

    This is my hole file:

     

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

        <xsl:variable name="test"/>

       

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <li>
           
                <xsl:value-of select="@nodeName"/>
                <p><xsl:value-of select="prentOmschrijving"/></p>
           
             
            <xsl:if test="$test != '' ">
    <xsl:value-of select="umbraco.library:GetMedia($test)" />
                <xsl:value-of select="./uploadImage"/>
    </xsl:if>
             
           
           
           

           
           
            <br/>
       
           
        </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

    </xsl:stylesheet>

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 16:18
    Alex Skrypnyk
    0

    try this:

    <?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"

      exclude-result-prefixes="msxml umbraco.library">

     

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

     

      <xsl:param name="currentPage"/>

     

      <xsl:template match="/">

     

        <!-- The fun starts here -->

        <ul>

          <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">

            <li>

              <xsl:value-of select="./@nodeName"/>

              <p>

                <xsl:value-of select="./prentOmschrijving"/>

              </p>

              <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" />

              <xsl:choose>

                <xsl:when test="$media">

                  <xsl:variable name="url" select="$media/umbracoFile" />

                  <xsl:variable name="width" select="$media/umbracoWidth" />

                  <xsl:variable name="height" select="$media/umbracoHeight" />

                  <img src="{$url}" width="{$width}" height="{$height}" />

                </xsl:when>

                <xsl:when test="string-length(./uploadImage) &gt; 0">

                  <img src ="{./uploadImage}" />

                </xsl:when>

              </xsl:choose>

              <br/>

            </li>

          </xsl:for-each>

        </ul>

      </xsl:template>

    </xsl:stylesheet>

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 16:27
    savantKing99
    0

    oke, thx,

     

    I have it now like this:

     

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

         

       

    <!-- The fun starts here -->
    <ul>
          <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
            <li>
              <xsl:value-of select="./@nodeName"/>
              <p>
                <xsl:value-of select="./prentOmschrijving"/>
              </p>
              <xsl:variable name="media" select="umbraco.library:GetMedia(./prentPlaatje1, 0)" />
              <xsl:choose>
                <xsl:when test="$media">
                  <xsl:variable name="url" select="$media/umbracoFile" />
                  <xsl:variable name="width" select="$media/umbracoWidth" />
                  <xsl:variable name="height" select="$media/umbracoHeight" />
                  <img src="{$url}" width="{$width}" height="{$height}" />
                </xsl:when>
                <xsl:when test="string-length(./uploadImage) &gt; 0">
                  <img src ="{./uploadImage}" />
                </xsl:when>
              </xsl:choose>
              <br/>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:template>
    </xsl:stylesheet>

    But I still get this error:

    Error parsing XSLT file: \xslt\ShowPrentsInEditor.xslt

     And if I try to save the xslt file:

     

    Error occured

    System.OverflowException: Value was either too large or too small for an Int32.
    at System.Convert.ToInt32(Double value)
    at System.Double.System.IConvertible.ToInt32(IFormatProvider provider)
    at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
    at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

     

     

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 16:41
    Alex Skrypnyk
    0

    try to change file direct on the disk, not via admin panel and set full right's for the folder

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 17:09
    savantKing99
    0

    I have done that. I openend in visuatl studio 2010. But the same result. And the folder full right .

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 17:19
    savantKing99
    0

    And other question, how to get css in it? like this: I mean where the three images are visible.

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 17:21
    Alex Skrypnyk
    0

    I don't understand what do you mean when say about css ?

    Just add class to the img tags )

     

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 17:28
    savantKing99
    0

    I mean so every time you create new product, with the properties: title, omschrijving, images, they will appear in a red box. Is there a way to ad css in the properties tab? by Generic properties?I mean that the css layout automatically will be loaded, like the other properties(title, omschrijving)

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 28, 2013 @ 17:43
    Alex Skrypnyk
    0

    Yes, you could add css class name property and than use them.

    Or create text field, where you will write css rules, and include this field in your page.

  • savantKing99 70 posts 120 karma points
    Mar 28, 2013 @ 17:44
    savantKing99
    0

    oke, But the images are still not showing. realy pitty

  • savantKing99 70 posts 120 karma points
    Mar 29, 2013 @ 17:03
    savantKing99
    0

    HI,

     

    I am triing it like this:

     

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

       

    <!-- The fun starts here -->
    <ul>
          <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
            <li>
              <xsl:value-of select="./@nodeName"/>
              <p>
               
                  <xsl:for-each select="umbraco.library:GetMedia($media, true())/Image">
     
     
      <xsl:variable name="prentPlaatje1" select="umbracoFile"/>
      <xsl:variable name="picW" select="umbracoWidth"/>
      <xsl:variable name="picH" select="umbracoHeight"/>
     
       
       
          <img>
              <xsl:attribute name="src"><xsl:value-of select="$prentPlaatje1"/></xsl:attribute> 
          </img>
       
       
        </xsl:for-each>




              </p>
            
              <br/>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:template>
    </xsl:stylesheet>

    But then I get this error:

    Error occuredError in XSLT at line 25, char 15
    23:       <p>
    24:      
    25: >>>   <xsl:for-each select="umbraco.library:GetMedia($media, true())/Image"> <<<
    26:      
    27:      

    Maybe you know how to solve that? I realy dont understand why it is so hard to get the image showing

     

  • savantKing99 70 posts 120 karma points
    Mar 29, 2013 @ 17:23
    savantKing99
    0

    I also try this:

     

    <?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" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:TC="urn:TC"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary TC ">

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

    <xsl:param name="currentPage"/>
           
    <xsl:variable name="media" select="$currentPage/prentPlaatje1" />


    <xsl:template match="/">

       

    <!-- The fun starts here -->
    <ul>
          <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
            <li>
              <xsl:value-of select="./@nodeName"/>
              <p>
                 
                 
                  <xsl:for-each select="umbraco.library:GetMedia($media, true())/Image">
        <xsl:variable name="picFile" select="umbracoFile"/>
        <xsl:variable name="picW" select="umbracoWidth"/>
        <xsl:variable name="picH" select="umbracoHeight"/>
        <img >
            <xsl:attribute name="src">
                <xsl:value-of select = "$picFile"/>
            </xsl:attribute>
        </img>
    </xsl:for-each>



              </p>
            
              <br/>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:template>
    </xsl:stylesheet>


  • savantKing99 70 posts 120 karma points
    Mar 29, 2013 @ 17:24
    savantKing99
    0

    Then I get this error:

     

    Error occured

    System.OverflowException: Value was either too large or too small for an Int32.
    at System.Convert.ToInt32(Double value)
    at System.Double.System.IConvertible.ToInt32(IFormatProvider provider)
    at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
    at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

  • savantKing99 70 posts 120 karma points
    Mar 29, 2013 @ 17:31
    savantKing99
    0

    I realy dont understand. Just want to have title, description and three images, that is all

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 29, 2013 @ 18:00
    Alex Skrypnyk
    0

    I can try to fix your problem on the site )

    Send me credentials to admin part )

    [email protected]

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 29, 2013 @ 18:02
    Alex Skrypnyk
    0

    do you use 6 umbraco ?

  • savantKing99 70 posts 120 karma points
    Mar 29, 2013 @ 18:18
    savantKing99
    0

    Yes(6.0.2), I have sent you email: niels.fischereinie

Please Sign in or register to post replies

Write your reply to:

Draft