We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17523
    • 3 Posts
    Hello

    On a Website for a Client I am using GalleryAlbum and Gallery Snippet Calls to display a list of the galleries in a top row and then a list of the image thumbnails in a gallery in a second row. On a click on an Thumbnail the bigger Image opens using Shadowbox.

    So far so good. Now the client asked me to include a Download Link for the original Hi-Res Image (not the php thumb resized one).

    Now I am asking myself how I could extract the path of the original file and insert it in the shadwobox markup.

    I figured out how to append the link in the Shadowbox window. I simply added some lines of code to the shadowbox.js

    S.img.prototype={append:function(body,dims){
    
    $('#sb-download a').remove();
    var linker=document.createElement("a");
    linker.id=this.id;linker.href=this.obj.content;
    sometext = document.createTextNode("Download Hi-Res");
    linker.appendChild(sometext);
    body.appendChild(linker);	
    	
    var img=document.createElement("img");img.id=this.id;img.src=this.obj.content;img.style.position="absolute";var height,width;
    


    This gives a working link. Maybe not elegant but it works.

    Also, I can extract the Path of the file by adding the following to the Gallery Snippet:
    $modx->setPlaceholder('imageURL', $itemArray['fileurl']);
    


    When inserted into the galItemThumb Chunk, this Placeholder gives outputs the file path.

    But I cannot use this placeholder (of course) outside of the Gallery Snippet environment. So how can I pass this path to the Shadowbox call in order to insert it into the href attribute of my link?

    Any help would be greatly appreciated.


    Greetings