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
    May 18, 2013 @ 20:04
    savantKing99
    0

    How to use ImageGen?

    Hi everybody,

    I've installed Imagegen. And I see the package ImageGen in: Section Developer - packages - installed packages 2 times.

    If I try this: localhost:8043/umbraco/ImageGen.ashx nothing happened:

    Server Error in '/' Application.

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /umbraco/ImageGen.ashx


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18034

     

    But that is the default image of Hello, World! isnt?

    But how to show that default image?

     

    THX

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 19, 2013 @ 11:15
    Douglas Robar
    0

    ImageGen is installed to the root of your site... the url in your example should be:

    http://localhost:8043/imagegen.ashx?version

    To use ImageGen, include it in the path of your <img src="" /> tag. For instance, if you have an image you want to resize that is located at /images/myphoto.jpg and you want to make a thumbnail that is 200px wide instead of sending the full size image to the browser and having the browser resize it with this tag:

    <img src="/images/myphoto.jpg" width=200" />

    You would resize and cache the image on the server with ImageGen and send the properly sized image to the browser with:

    <img src="/imagegen.ashx?image=/images/myphoto.jpg&width=200" />

    Hope this helps.

    cheers,
    doug. 

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 11:45
    savantKing99
    0

    Hi Douglass,

    Thanks, I see now the default image: Hello world.

    But I have a 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"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour ">

    <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>
                <b> Titel:</b>&nbsp;<xsl:value-of select="./@nodeName"/>
               
                <p>
                    <b>Omschrijving:</b>&nbsp;  <xsl:value-of select="./omschrijving"/>
              </p>
               
                <p>
                    <b>Prijs:</b>&nbsp;  <xsl:value-of select="prijs"/>
              </p>
               
               
              <p>
                <xsl:choose>
                  <xsl:when test="string-length(./porseleinPlaatje1) &gt; 0">
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje1, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />
                     
                  </xsl:when>
                  <xsl:otherwise>
                    <img src="{./uploadImage}" />
                  </xsl:otherwise>
                </xsl:choose>
              </p>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:template>
    </xsl:stylesheet>

    And I have the images stored in de Media section. the thumbnails are: 90x120. But how to manage if you press on a thumbnail you will get a larger format of the image, like 200x400?

    Thanks

     

    Niels

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 12:07
    savantKing99
    0

    I try something like this:

    <p>
                <xsl:choose>
                  <xsl:when test="string-length(./porseleinPlaatje1) &gt; 0">
                      <img src="/localhost:8043/imagegen.ashx?image=/media/porseleinen/porseleinPlaatje1.jpg&width=200, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />
                     
                  </xsl:when>
                  <xsl:otherwise>
                    <img src="{./uploadImage}" />
                  </xsl:otherwise>
                </xsl:choose>
              </p>

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 19, 2013 @ 12:23
    Douglas Robar
    0

    What you've got looks good, but two things are not correct.

    First, you will still need to convert from the media id storted in the porseleinPlaatje1 property to it's full image path using the GetMedia() function. Second, remember that you need to escape the & character when in xslt. Also, you don't need to specify the hostname in the <img src=""> parameter.

    <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1), true())/umbracoFile}&amp;width=90&amp;height=120" />

    To make this thumbnail image a link to a larger image, put an anchor around the image tag:

    <a href="">
        <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1), true())/umbracoFile}&amp;width=90&amp;height=120" />
    </a> 

    What you put in the href="" is up to you. It might be a link to the full-size image or to another size processed by ImageGen.

    Possibly either:

    <a href="{umbraco.library:GetMedia(porseleinPlaatje1), true())/umbracoFile}">

    or

    <a href="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1), true())/umbracoFile}&amp;width=200&amp;height=400"">

     

     

    Also, I'm assuming the images stored in the media section are large images. Otherwise you run the risk of having ImageGen up-scale the images and the quality will be poor in that case.

    cheers,
    doug. 

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 12:31
    savantKing99
    0

    Ok. I have it now like this for the first porseleinImage:

    <p>
                <xsl:choose>
                  <xsl:when test="string-length(./porseleinPlaatje1) &gt; 0">
                     <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1), true())/umbracoFile}&amp;width=90&amp;height=120" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />
                      
                  </xsl:when>
                  <xsl:otherwise>
                    <img src="{./uploadImage}" />
                  </xsl:otherwise>
                </xsl:choose>
              </p>

    But then I get this error:

    Error occured

    System.Xml.Xsl.XslLoadException: Expected token '}', found ','.
    ...rary:GetMedia(porseleinPlaatje1) -->,<-- true())/umbracoFile}&width=90&h... An error occurred at C:\Users\SavantKing99\Documents\My Web Sites\Umbraco CMS5\xslt\635045633727465672_temp.xslt(34,6).
    at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
    at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 12:32
    savantKing99
    0

    And how to comment the xslt code what you do? I mean in this forum.

    I triied like this: [code][/code] but that doesnt work

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 13:02
    savantKing99
    0

    I also triied like this:

    {code}

     


               
                 
                     

                       
                   
                       
                   
                     
                 
                 
       <p>
                <xsl:choose>
                  <xsl:when test="string-length(./porseleinPlaatje1) &gt; 0">
                      <img src="/imagegen.ashx?image={umbraco.library:GetMedia(./porseleinPlaatje1), true())/umbracoFile}" />

                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />
                      
                  </xsl:when>
                  <xsl:otherwise>
                    <img src="{./uploadImage}" />
                  </xsl:otherwise>
                </xsl:choose>
              </p>             
                 
               
             

    {/code}

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 19, 2013 @ 14:36
    Douglas Robar
    0

    Sorry about that... that's what I get for typing code into the forum without testing it first. I had an extra closing parenthesis, which is exactly what the error pointed to.

    It should be:

     <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1, false())/umbracoFile}&amp;width=90&amp;height=120" />

    Also, in this case you want to use false() as the second parameter to the GetMedia() function because you only want to return a single image and not look deep into the media tree for all children and grandchildren recursively. Using the false() parameter will make the GetMedia() call as fast as possible.

    By the way, to mark something as 'code' highlight the line in the post and select the 'Preformatted' format from the styles drop down, rather than the 'Paragrah' style.

    cheers,
    doug. 

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 14:45
    savantKing99
    0

    Oke,

    I have that :)

    it works.

     

    But How to get an JQuery lightbox like this:

    http://www.diplo.co.uk/pictures/gran-turismo-5.aspx?

    So that you click on an thumbnail and you will get an bigger format in a JQuery box?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    May 19, 2013 @ 15:34
    Dennis Aaen
    0

    Hi savantKing99,

    On one of my projects I have made a picture gallery and when you click on the thumbnail, the large picture comes up in a Lightbox.

     <xsl:for-each select="$mediaItems/Image">
            <xsl:variable name="picFile" select="umbracoFile"/>
             
              <div class="thumb">

              <!-- this can be used to link to the image -->

              <xsl:element name="a">
                  <xsl:attribute name="href">
                  <xsl:value-of select="./umbracoFile" />
                </xsl:attribute>
                   <xsl:attribute name="title">
                  <xsl:value-of select="./@nodeName" />
                </xsl:attribute>

                <!-- the rel and id attribute can be used to fire fancybox -->

                <xsl:attribute name="id">
                  <xsl:text>gallery</xsl:text>
                </xsl:attribute>

                <xsl:attribute name="rel">
                    <xsl:text>lightbox[galleryImages]</xsl:text>
                </xsl:attribute>

                <img>
                  <xsl:attribute name="src">
                    <xsl:text>/ImageGen.ashx?image=</xsl:text>
                    <xsl:value-of select="$picFile"/>
                    <xsl:text>&amp;width=146&amp;height=98%&amp;constrain=true</xsl:text>
                  </xsl:attribute>
                </img>
                 

              </xsl:element>
            </div>
      
          </xsl:for-each>

    I my solution I have used the Lightbox 2. On this page http://lokeshdhakar.com/projects/lightbox2/ you can read how to set it up on your site. So you just include the javascript files to your project and add the rel="lightbox" to your a tag.

    I hope this can help you to get a solution.

    /Dennis

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 19:16
    savantKing99
    0

    Oke, thanks,

     

    but I include the js and the css scripts in the Settings - Scripts folder? Because normaly you will do it in the HTML page. So in Umbraco By content, but that doesnt works. So I triied like this:


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>

    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/lightbox.js"></script>
    <link href="css/lightbox.css" rel="stylesheet" />


    <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"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour ">

    <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>
                <b> Titel:</b>&nbsp;<xsl:value-of select="./@nodeName"/>
               
                <p>
                    <b>Omschrijving:</b>&nbsp;  <xsl:value-of select="./omschrijving"/>
              </p>
               
                <p>
                    <b>Prijs:</b>&nbsp;  <xsl:value-of select="prijs"/>
              </p>
               
               
              <p>
                <xsl:choose>
                  <xsl:when test="string-length(./porseleinPlaatje1) &gt; 0">
                     
                      <a href="{umbraco.library:GetMedia(./porseleinBiggerSize, true())/umbracoFile}">
                     <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1, false())/umbracoFile}&amp;width=120&amp;height=80" />
                      </a>
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />
                     
                  </xsl:when>
                  <xsl:otherwise>
                    <img src="{./uploadImage}" />
                  </xsl:otherwise>
                </xsl:choose>
              </p>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:template>
    </xsl:stylesheet>

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 19:23
    savantKing99
    0
  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 19:48
    savantKing99
    0

    I try it like this:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>

    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/lightbox.js"></script>
    <link href="css/lightbox.css" rel="stylesheet" />


    <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"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour ">

    <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>
                <b> Titel:</b>&nbsp;<xsl:value-of select="./@nodeName"/>
               
                <p>
                    <b>Omschrijving:</b>&nbsp;  <xsl:value-of select="./omschrijving"/>
              </p>
               
                <p>
                    <b>Prijs:</b>&nbsp;  <xsl:value-of select="prijs"/>
              </p>
               
               
              <p>
                <xsl:choose>
                  <xsl:when test="string-length(./porseleinPlaatje1) &gt; 0">
                     
                      <a href="{umbraco.library:GetMedia(./porseleinBiggerSize, true())/umbracoFile}">
                     <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1, false())/umbracoFile}&amp;width=120&amp;height=80" />
                      </a>
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />
                     
                  </xsl:when>
                  <xsl:otherwise>
                    <img src="{./uploadImage}" />
                  </xsl:otherwise>
                </xsl:choose>
              </p>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:template>
    </xsl:stylesheet>

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 21:41
    savantKing99
    0

    I try something 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"
    exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour ">

    <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>
    <b> Titel:</b>&nbsp;<xsl:value-of select="./@nodeName"/>

    <p>
    <b>Omschrijving:</b>&nbsp; <xsl:value-of select="./omschrijving"/>
    </p>

    <p>
    <b>Prijs:</b>&nbsp; <xsl:value-of select="prijs"/>
    </p>


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

    <a href=" {umbraco.library:GetMedia(./porseleinBiggerSize, true())/umbracoFile}&amp rel = "lightbox" ">
    <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1, false())/umbracoFile}&amp;width=120&amp;height=80" />
    </a>
    &nbsp;
    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
    &nbsp;
    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />

    </xsl:when>
    <xsl:otherwise>
    <img src="{./uploadImage}" />
    </xsl:otherwise>
    </xsl:choose>
    </p>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:template>
    </xsl:stylesheet>




    And I have put all the scripts in the masterPage in the section: Settings - templates:
    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
       

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Antiek Brocante, welkom</title>
    <meta name="keywords" content="Lin Photo, free website template, XHTML CSS layout" />
    <meta name="description" content="Antiek Brocante" />
    <link href="css/Site.css" rel="stylesheet" type="text/css" />
    <link href="css/thumbnailViewer.css" rel="stylesheet" type="text/css" />
    <script src = "Scripts/thumbnailViewer.js" type = "text/javascript" />
       
    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/lightbox.js"></script>
    <link href="css/lightbox.css" rel="stylesheet" />
  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 21:57
    savantKing99
    0

    I also triied like this:

     <p>
                <xsl:choose>
                  <xsl:when test="string-length(./porseleinPlaatje1) &gt; 0">
                     
                      <a href="{umbraco.library:GetMedia(porseleinPlaatje1, true())/umbracoFile}&amp; rel=lightbox ">
                     <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1, false())/umbracoFile}&amp;width=120&amp;height=80" />
                      </a>
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />
                     
                  </xsl:when>
                  <xsl:otherwise>
                    <img src="{./uploadImage}" />
                  </xsl:otherwise>
                </xsl:choose>
              </p>
  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    May 19, 2013 @ 22:09
    Dennis Aaen
    0

    Hi,

    Try this, and see if it has any effect.

    <%@MasterLanguage="C#"MasterPageFile="~/umbraco/masterpages/default.master"AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault"runat="server">
       

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <htmlxmlns="http://www.w3.org/1999/xhtml">
    <head>
    <metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/>
    <title>Antiek Brocante, welkom</title>
    <metaname="keywords"content="Lin Photo, free website template, XHTML CSS layout"/>
    <metaname="description"content="Antiek Brocante"/>
    <linkhref="css/Site.css"rel="stylesheet"type="text/css"/>
    <linkhref="css/thumbnailViewer.css"rel="stylesheet"type="text/css"/>
    <scriptsrc="Scripts/thumbnailViewer.js"type="text/javascript"/>
       
    <script src="/js/jquery-1.7.2.min.js"></script>
    <scriptsrc="/js/lightbox.js"></script>
    <linkhref="/css/lightbox.css"rel="stylesheet"/>

    I just added an extra /

    /Dennis

  • savantKing99 70 posts 120 karma points
    May 19, 2013 @ 22:16
    savantKing99
    0

    ok.

    but this is correct?

        
              <p>
                <xsl:choose>
                  <xsl:when test="string-length(./porseleinPlaatje1) &gt; 0">
                     
                      <a href="{umbraco.library:GetMedia(porseleinPlaatje1, true())/umbracoFile}rel=lightbox">
                     <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1, false())/umbracoFile}&amp;width=120&amp;height=80" />
                      </a>
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />
                     
                  </xsl:when>
                  <xsl:otherwise>
                    <img src="{./uploadImage}" />
                  </xsl:otherwise>
                </xsl:choose>
              </p>
    Because I get now this:

    HTTP Error 404.0 - Not Found

    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    Most likely causes:

    • The directory or file specified does not exist on the Web server.
    • The URL contains a typographical error.
    • A custom filter or module, such as URLScan, restricts access to the file.

    Things you can try:

    • Create the content on the Web server.
    • Review the browser URL.
    • Check the failed request tracing log and see which module is calling SetStatus. For more information, click here.

    Detailed Error Information:

    Module    IIS Web Core
    Notification    MapRequestHandler
    Handler    StaticFile
    Error Code    0x80070002
    Requested URL    http://localhost:8043/media/1030/_mg_1002.jpgrel=lightbox
    Physical Path    C:\Users\SavantKing99\Documents\My Web Sites\Umbraco CMS5\media\1030\_mg_1002.jpgrel=lightbox
    Logon Method    Anonymous
    Logon User    Anonymous
    Request Tracing Directory    C:\Users\SavantKing99\Documents\IISExpress\TraceLogFiles\UMBRACO CMS5



  • Stephen Dougherty 23 posts 45 karma points
    May 20, 2013 @ 01:20
    Stephen Dougherty
    0

    The problem is the rel tag you have put as part of the href

    Try this:

     

    <p>
               
    <xsl:choose>
                 
    <xsl:whentest="string-length(./porseleinPlaatje1) &gt; 0">
                     
                     
    <ahref="{umbraco.library:GetMedia(porseleinPlaatje1, true())/umbracoFile}" rel="lightbox">
                     
    <imgsrc="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1, false())/umbracoFile}&amp;width=120&amp;height=80"/>
                     
    </a>
                       
                   
    <imgsrc="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}"/>
                       
                   
    <imgsrc="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}"/>
                     
                 
    </xsl:when>
                 
    <xsl:otherwise>
                   
    <imgsrc="{./uploadImage}"/>
                 
    </xsl:otherwise>
               
    </xsl:choose>
             
    </p>
  • Stephen Dougherty 23 posts 45 karma points
    May 20, 2013 @ 01:24
    Stephen Dougherty
    0

    Posting the code above seems to have got rid of spaces between imgsrc so ignore these but the rel attribute should be separate from the href attribute.

  • savantKing99 70 posts 120 karma points
    May 20, 2013 @ 01:36
    savantKing99
    0

    Hi,

     

    I have it now like this:

     


                   
              <p>
                <xsl:choose>
                  <xsl:when test="string-length(./porseleinPlaatje1) &gt; 0">
                     
                      <a href="{umbraco.library:GetMedia(porseleinPlaatje1, true())/umbracoFile}" rel="lightbox">
                     <img src="/imagegen.ashx?image={umbraco.library:GetMedia(porseleinPlaatje1, false())/umbracoFile}&amp;width=120&amp;height=80" />
                      </a>
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./porseleinPlaatje3, true())/umbracoFile}" />
                     
                  </xsl:when>
                  <xsl:otherwise>
                    <img src="{./uploadImage}" />
                  </xsl:otherwise>
                </xsl:choose>
              </p>
                 
                     
                 
                   
                 
               
             



    But I dont see the lightbox. The other image will be showing in this url: http://localhost:8043/media/1030/_mg_1002.jpg. But not as a lightbox

  • savantKing99 70 posts 120 karma points
    May 20, 2013 @ 09:48
    savantKing99
    0

    I see it now like this when I press on the thumbnail

  • savantKing99 70 posts 120 karma points
    May 20, 2013 @ 12:14
    savantKing99
    0

    This is my master page:

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
       

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Antiek Brocante, welkom</title>
    <meta name="keywords" content="Lin Photo, free website template, XHTML CSS layout" />
    <meta name="description" content="Antiek Brocante" />
    <link href="css/Site.css" rel="stylesheet" type="text/css" />
    <link href="css/thumbnailViewer.css" rel="stylesheet" type="text/css" />
    <script src = "Scripts/thumbnailViewer.js" type = "text/javascript" />
       
        <script src="js/jquery-1.7.2.min.js"></script>
        <script src="js/lightbox.js"></script>
        <link href="css/lightbox.css" rel="stylesheet" />
       
       
       
    <script language="javascript" type="text/javascript">
        function clearText(field) {
            if (field.defaultValue == field.value) field.value = '';
            else if (field.value == '') field.value = field.defaultValue;
        }
    </script>
    </head>
    <body>

    <div id="templatemo_container">
        <div id="templatemo_banner">
            <div id="logo"></div>      
            <div id="search_section">
                <form action="#" method="get">
                    &nbsp;
                    <>
               
            </div>

        </div> <!-- end of banner -->
       
       <div id="templatemo_menu">
           
          
           <umbraco:Macro Alias="MainNavigation" runat="server"></umbraco:Macro>
          
          
        </div> <!-- end of menu -->

        <div id="templatemo_content_wrapper">
            <div id="templatemo_content">   
            <div class="column_w210 fl">      
           

         <form id = "form1" runat ="server">  
    <asp:ContentPlaceHolder Id="InnerContent" runat="server">
        <!-- Insert default "InnerContent" markup here -->
    </asp:ContentPlaceHolder>
               
                </form>
               
                       <div class="column_w210 fl vl_divider">
           
               
            </div> <!-- end of a column -->  
               
               
               
                
            <div class="margin_bottom_20 h_divider"></div>       
            <div class="margin_bottom_20"></div>
           
            <div class="column_w920">
           
          <div class="column_w190 fl margin_right_40">
              <a href="#"><img src="/images/image63C.jpg" alt="image" /></a>
                  <p>Een mooie collecite van koper <a href="http://www.antiekbrocante.nl/koper.aspx">lees meer...</a></p>               
              </div>
               
          <div class="column_w190 fl margin_right_40">
                    <a href="#"><img src="images/kristalFooter.jpg" alt="image" /></a>
              <p>Een mooie collecite van kristal <a href="http://www.antiekbrocante.nl/kristal.aspx">lees meer...</a></p>               
              </div>
               
          <div class="column_w190 fl margin_right_40">
                    <a href="#"><img src="images/zilverFooter.jpg" alt="image" /></a>
              <p>Een mooie collecite van zilver <a href="http://www.antiekbrocante.nl/zilver.aspx">lees meer...</a></p>               
              </div>
               
          <div class="column_w190 fl">
                    <a href="#"><img src="images/schilderijFooter.jpg" alt="image" /></a>
              <p>Een mooie collecite van schilderijen <a href="http://www.antiekbrocante.nl/schilderijen.aspx">lees meer...</a></p>               
              </div>
           
                 <div class="margin_bottom_15"></div>
            </div>
       
            <div class="cleaner"></div>
        </div>      
        </div>
       
        <div id="templatemo_footer">
       
        <ul class="footer_list">
                <a href="#" class="current">Home</a>          
                       
            </ul>
           
            <div class="margin_bottom_10"></div>
           
            Copyright © 2013 <a href="#">
            Design by Microrout.nl</a> microrout <a href="http://www.microrout.nl"></a>&nbsp;
           
            <div class="margin_bottom_10"></div>
           
            &nbsp;
                   
           </div>
    </div>
    <div align=center></div>
    </form>
    </body>
    </html>
    </asp:Content>
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 20, 2013 @ 12:40
    Douglas Robar
    100

    It looks like you now have a basic lightbox implementation running from what I can see. At least most of it. I say this because in your screenshot the background is grayed out and the image is floating in the center of the browser window. 

    What is curious to me is that the image is so small. Is this the full-size version of the image stored in the media section? If so, you will want to consider using much larger images in the media section and letting ImageGen resize them to whatever size(s) you want for your thumbnails and also in the lightbox implementation. 

    Though ImageGen can resize an image to be larger than its original size that will give a very poor quality image for the website visitor. Much better to save large versions and resize them to smaller sizes with ImageGen.

    cheers,
    doug. 

     

  • savantKing99 70 posts 120 karma points
    May 20, 2013 @ 12:47
    savantKing99
    0

    Yes, I have bigger format: 640x480.

    But it is just for testing. Because in any case the lightbox is not shown in this case. how I have it now. Small image or big image

Please Sign in or register to post replies

Write your reply to:

Draft