Copied to clipboard

Flag this post as spam?

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


  • Henrik Hammarström 58 posts 54 karma points
    Mar 02, 2011 @ 16:55
    Henrik Hammarström
    0

    After upgrading to 4.5.2

    Hi
    After I upgraded to 4.5.2 almost everything work exept an gallaery I have and it this code snippet that doesent work...

    <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
        <div class="Item">
            <!-- get first photo thumbnail -->
            <a href="{umbraco.library:NiceUrl(@id)}">
                <img src="{./data [@alias='ThumbImage']}" width="90" height="90" alt="{@nodeName}"/>
            </a>
        </div>

    </xsl:for-each>

     

  • John C Scott 473 posts 1183 karma points
    Mar 02, 2011 @ 18:01
    John C Scott
    0

    this is almost certainly due to the xml schema changing

    try...

    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <div class="Item">
            <!-- get first photo thumbnail -->
            <a href="{umbraco.library:NiceUrl(@id)}">
                <img src="{concat(substring-before(umbracoFile,'.'), '_thumb.jpg')}" width="90" height="90" alt="{@nodeName}"/>
            </a>
        </div>

    </xsl:for-each>

    i'm not entirely sure about the img src i'm going to just check this further...

  • John C Scott 473 posts 1183 karma points
    Mar 02, 2011 @ 18:07
    John C Scott
    0

    In the above is ThumbImage a generic property of the document type or is it using the thumbnail made by umbraco?

  • Henrik Hammarström 58 posts 54 karma points
    Mar 03, 2011 @ 16:24
    Henrik Hammarström
    0

    Hi
    its  a generic property that I made..
    Its an old gallery where they uploaded an thumbnail and one bigger picture,,,

    The old code look like this and I listed all thumbnails on that level

    <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
        <div class="Item">
            <!-- get first photo thumbnail -->
            <a href="{umbraco.library:NiceUrl(@id)}">
                <img src="{./data [@alias='ThumbImage']}" width="90" height="90" alt="{@nodeName}"/>
            </a>
        </div>

     

    Now I try with this code after upgrading 

    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <div class="Item">
            <!-- get first photo thumbnail -->
            <a href="{umbraco.library:NiceUrl(@id)}">
                <img src="{concat(substring-before(umbracoFile,'.jpg'), '')}" width="90" height="90" alt="{@nodeName}"/>
            </a>
        </div>

    </xsl:for-each>

    I want  <img src="filepath/filename + extension" .....

    /Henrik


  • John C Scott 473 posts 1183 karma points
    Mar 03, 2011 @ 16:28
    John C Scott
    0

    Does ThumbImage contain this?

    Can you just write...

    <img src="{ThumbImage}" width="90" height="90" alt="{@nodeName}"/>

    The new schema is so much easier to read when you get used to it :)

  • Henrik Hammarström 58 posts 54 karma points
    Mar 03, 2011 @ 18:21
    Henrik Hammarström
    0

    Perfect it works...

    How about this one

    Its so I can step from first to last picture

    <xsl:if test="count($currentPage/preceding-sibling::node) > 0">
    <a href="{umbraco.library:NiceUrl($Previous)}">
    « Föregående
    </a>
    </xsl:if>

    /H

Please Sign in or register to post replies

Write your reply to:

Draft