Copied to clipboard

Flag this post as spam?

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


Copy Link
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    May 12, 2009 @ 17:08
    Warren Buckley
    0

    Sorry to but in here guys.
    But is it something as simple as that you need to change $currentPage to current() in your xsl:for-each loop? Otherwise for each of the items you will be looping out the same image for each of the nodes found in $currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']

    For example
    [code][/code]

    This maybe of help, I am not sure.
    Warren :)

    Copy Link
  • ayyaz 20 posts 21 karma points
    May 12, 2009 @ 18:01
    ayyaz
    0

    thanks for the help..

    i got the following working


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






    Best regards,
    Ayyaz Ahmed

    Copy Link
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    May 12, 2009 @ 18:05
    Warren Buckley
    0

    Yep glad you got it solved.
    For anyone who is reading this post in the future using the following are all the same:

    [code]

    [/code]

    [code]

    [/code]

    [code]

    [/code]

    I hope that helps out anyone who uses this post as a point of reference.

    Warren :)

    Copy Link
  • SiKo279 82 posts 238 karma points
    Aug 26, 2009 @ 11:06
    SiKo279
    0

    I can not see the OP's initial code, and also want to display thumbnails of the pages below the current page.

    Obviously I used the macro template 'List subpages as thumbnails', but I miss the pictures.

    Where do I insert the pictures? As a property on the documents? Alias name?

    Bit confused as the xslt code is not clear to me.

    Thanks!

    Copy Link
  • Nik Wahlberg 639 posts 1237 karma points MVP
    Aug 27, 2009 @ 03:39
    Nik Wahlberg
    0

    Hi SiKo279,

    the following:

    umbraco.library:GetMedia(./data[@alias='providerLogo'], 'false')/data[@alias = 'umbracoFile']

    Basically says, in the current node's children select the node with an alias of providerLogo (the field that contains the ID of the media that has been selected as part of the 'page' creation). In the node, get me the node of type data where the alias is 'umbracoFile' (ie. the path to the file mathching the ID in the previous statement). Change the 'providerLogo' with the name of your document type attribute and you should be good to go.

    Hope this helps.

    -- Nik

    Copy Link
  • SiKo279 82 posts 238 karma points
    Aug 27, 2009 @ 06:30
    SiKo279
    0

    Thank you for explaining that part of the puzzle!

    I still don't have my xslt displaying a picture.

    I added to my document type a property called 'pageThumb' and I'm using the following code (note, I know it's not correct, but this way I hoped to see at least the path to the image, but no results :()

     

    <xsl:template match="/">

    <!-- The fun starts here -->
    <!-- [string(data [@alias='umbracoNaviHide']) != '1'] -->
    <xsl:for-each select="$currentPage/node ">
    <div style="text-align: center; width: 150px; height: 125px; float: left; border: 1px solid #999; background-color: #EDEDED; padding: 5px; margin: 10px;" onMouseOver="this.style.backgroundColor='CCC';" onMouseOut="this.style.backgroundColor='#EDEDED';">

    <!-- get first photo thumbnail -->
    <a href="{umbraco.library:NiceUrl(@id)}">
      <xsl:if test="count(./node) &gt; 0">
        <xsl:value-of select="umbraco.library:GetMedia(data[@alias='pageThumb'], 'false')/data[@alias = 'umbracoFile']"/>
        <img src="" style="border: none;"/><br/>
      </xsl:if>
      <b><xsl:value-of select="@nodeName"/></b><br/>
    </a>
    <xsl:value-of select="count(./node)"/> Photo(s)
    </div>
    </xsl:for-each>

    </xsl:template>

    (or, just a test, as we cannot edit messages yet)

    [code]

    <xsl:template match="/">

    <!-- The fun starts here -->
    <!-- [string(data [@alias='umbracoNaviHide']) != '1'] -->
    <xsl:for-each select="$currentPage/node ">
    <div style="text-align: center; width: 150px; height: 125px; float: left; border: 1px solid #999; background-color: #EDEDED; padding: 5px; margin: 10px;" onMouseOver="this.style.backgroundColor='CCC';" onMouseOut="this.style.backgroundColor='#EDEDED';">

    <!-- get first photo thumbnail -->
    <a href="{umbraco.library:NiceUrl(@id)}">
      <xsl:if test="count(./node) &gt; 0">
        <xsl:value-of select="umbraco.library:GetMedia(data[@alias='pageThumb'], 'false')/data[@alias = 'umbracoFile']"/>
        <img src="" style="border: none;"/><br/>
      </xsl:if>
      <b><xsl:value-of select="@nodeName"/></b><br/>
    </a>
    <xsl:value-of select="count(./node)"/> Photo(s)
    </div>
    </xsl:for-each>

    </xsl:template>

    [/code]

    Copy Link
  • SiKo279 82 posts 238 karma points
    Aug 27, 2009 @ 07:15
    SiKo279
    0

    Ok, I found the solution:

        <xsl:template match="/">

            <!-- The fun starts here -->
            <!-- [string(data [@alias='umbracoNaviHide']) != '1'] -->
            <xsl:for-each select="$currentPage/node ">
                <div style="text-align: center; width: 150px; height: 125px; float: left; border: 1px solid #999; background-color: #EDEDED; padding: 5px; margin: 10px;" onMouseOver="this.style.backgroundColor='CCC';" onMouseOut="this.style.backgroundColor='#EDEDED';">

                    <!-- get first photo thumbnail -->
                    <a href="{umbraco.library:NiceUrl(@id)}">
                        <xsl:if test="string(data [@alias='pageThumb'])">
                            <img style="border: none;">
                                <xsl:attribute name="src">
                                    <xsl:value-of select="umbraco.library:GetMedia(data [@alias = 'pageThumb'], 'false')/data [@alias = 'umbracoFile']"/>
                                </xsl:attribute>
                            </img>
                            <br/>
                        </xsl:if>
                        <b>
                        <xsl:value-of select="@nodeName"/>
                        </b>
                        <br />
                        <br />
                    </a>
                    <xsl:value-of select="count(./node)"/> Photo(s)
                </div>
            </xsl:for-each>

        </xsl:template>

    Copy Link
  • Please Sign in or register to post replies

    Write your reply to:

    Draft