Copied to clipboard

Flag this post as spam?

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


  • Daniel Blomberg 21 posts 41 karma points
    Dec 12, 2011 @ 10:47
    Daniel Blomberg
    0

    I can't get the photos showing

    Hi,

    I have difficulties with my photos. The specific photos doesn't pop up on the screen when selected from a gallery. I can't find anything different in it's corresponsing template. I have tried to make sense of the macro/xslt but can't find any apparent mistakes or faults. What could be the problem?

    Best, Daniel

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Dec 12, 2011 @ 10:57
    Warren Buckley
    0

    Hi Daniel,
    When you say "photos do not pop up on the screen when selected from a gallery" are you trying to implement some jQuery lightbox effect?

    Cheers,
    Warren 

  • Daniel Blomberg 21 posts 41 karma points
    Dec 12, 2011 @ 11:17
    Daniel Blomberg
    0

    Hi again,

    no I just described it a bit sloppy. I meant that they just don't show at all. I have implemented the macro DisplayPhoto but when I click a photo everything shows up on that page except the photo itself.

    Cheers, Daniel

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Dec 12, 2011 @ 11:32
    Warren Buckley
    0

    OK Daniel,
    Are you able to provide some more details to the problem please.

    What does your macro contain, Razor or XSLT?
    If you copy and paste your macro code here I can take a look and see what it is trying to do. (Remember to use the code format from the dropdown)

    Cheers,
    Warren 

  • Daniel Blomberg 21 posts 41 karma points
    Dec 12, 2011 @ 14:09
    Daniel Blomberg
    0

    Hi again, I am following your tutorial, building the CWS. And I believe that the macros are 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"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

      <!--
      =====================================================================================
        Changed ouput from XML to html. As if we are only have 1 photo in
        gallery, there would be no pagination and create bad markup
        which breaks the design.
        
        eg:
        <div class="pager clearfix"/> as opposed to <div class="pager clearfix"></div>
      =====================================================================================
      -->
    <xsl:output method="html" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

      <div class="photo">
        
        <!-- Next & Previous Variables -->
        <xsl:variable name="Previous" select="$currentPage/preceding-sibling::Photo [1]/@id"/>
        <xsl:variable name="Next"     select="$currentPage/following-sibling::Photo [1]/@id"/>
        
        <!-- Next & Previous links to photos -->
        <div class="pager clearfix">
          <xsl:if test="count($currentPage/preceding-sibling::* [@isDoc]) > 0">
            <a href="{umbraco.library:NiceUrl($Previous)}" class="left prev">
              Previous
            </a>
          </xsl:if>
          
          <xsl:if test="count($currentPage/following-sibling::* [@isDoc]) > 0">
            <a href="{umbraco.library:NiceUrl($Next)}" class="right next">
              Next
            </a>
          </xsl:if>
        </div>    
        
        <div class="item">
          <!-- Photo -->
          <img src="{photo}" alt="{photoText}" />
          
          <!-- Photo Text overlay -->
          <xsl:if test="$currentPage/photoText != ''">
            <span>
              <xsl:value-of select="$currentPage/photoText"/>
            </span>
          </xsl:if>
        </div>    
        
      </div>

    </xsl:template>

    </xsl:stylesheet>

     

    Cheers,

    Daniel

  • Daniel Blomberg 21 posts 41 karma points
    Dec 12, 2011 @ 14:10
    Daniel Blomberg
    0

    Hi again, I am following your tutorial, building the CWS. And I believe that the macros are 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"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

      <!--
      =====================================================================================
        Changed ouput from XML to html. As if we are only have 1 photo in
        gallery, there would be no pagination and create bad markup
        which breaks the design.
        
        eg:
        <div class="pager clearfix"/> as opposed to <div class="pager clearfix"></div>
      =====================================================================================
      -->
    <xsl:output method="html" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

      <div class="photo">
        
        <!-- Next & Previous Variables -->
        <xsl:variable name="Previous" select="$currentPage/preceding-sibling::Photo [1]/@id"/>
        <xsl:variable name="Next"     select="$currentPage/following-sibling::Photo [1]/@id"/>
        
        <!-- Next & Previous links to photos -->
        <div class="pager clearfix">
          <xsl:if test="count($currentPage/preceding-sibling::* [@isDoc]) > 0">
            <a href="{umbraco.library:NiceUrl($Previous)}" class="left prev">
              Previous
            </a>
          </xsl:if>
          
          <xsl:if test="count($currentPage/following-sibling::* [@isDoc]) > 0">
            <a href="{umbraco.library:NiceUrl($Next)}" class="right next">
              Next
            </a>
          </xsl:if>
        </div>    
        
        <div class="item">
          <!-- Photo -->
          <img src="{photo}" alt="{photoText}" />
          
          <!-- Photo Text overlay -->
          <xsl:if test="$currentPage/photoText != ''">
            <span>
              <xsl:value-of select="$currentPage/photoText"/>
            </span>
          </xsl:if>
        </div>    
        
      </div>

    </xsl:template>

    </xsl:stylesheet>

     

    Cheers,

    Daniel

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Dec 12, 2011 @ 14:44
    Warren Buckley
    0

    Hi Daniel,
    Yes that is an XSLT macro and I have taken another look at my example code that is for the tutorial and there seems to be a small typo in the code.

    Change the line:
    <!-- Photo -->
    <img src="{photo}" alt="{photoText}" />

    To the following:

    <!-- Photo -->
    <img src="{$currentPage/photo}" alt="{
    $currentPage/photoText}" />

    Let me know if this then fixes the problem.
    But thanks for bringing this to my attention, as I can update the example tutorial file as well.

    Cheers,
    Warren 

  • Daniel Blomberg 21 posts 41 karma points
    Dec 12, 2011 @ 15:26
    Daniel Blomberg
    0

    Hi again,

    yes this solves the problem! Thank you! I started to understand that it had to be the XSLT that was the bad guy but I am unfortunately to much of a novise on it to be able to find the problem myself so again thank you!

    I have found a number of smaller differences in the files downloaded for the tutorial. This (the XSLT DisplayPhoto), the missing \ for the CSS-pathing. The default chosen master templates in the template files. They haulted me at least 2-3 hours each. Frustrating but good for my over all learning process and good because it made me use the forums:)

    Cheers, Daniel

Please Sign in or register to post replies

Write your reply to:

Draft