1

I'm a complete newb to Sharepoint and am picking up someone else's work for our company intranet. We're only using SP 2010 and I have no access to SPD.

I know you can add a linkarray variable to a script but can these then be implemented to replace the image links? The same question was asked here with a suggestion to create a SO post.

https://blog.vgrem.com/2013/04/27/beyond-the-slideshow-web-part-capabilities-in-sharepoint-2010/#comment-2976

This is my current script which fires from a content editor above the slideshow to restore the original image sizes.

I've added the var linkarray but am unsure how that can be used for the links.

Thanks

<script type="text/javascript"> function SlideshowObjectInitializer() 

{  ShowPic = (function(ShowPicOrig) 
{  return function() {

       var ssObj = arguments[0];  //SlideShow object
       var curPicIdx=ssObj.index; //current picture index
   var linkArray = ['http://ws-intranet.article1.com/default.aspx','http://ws-intranet.article2.com/hackathon.aspx'];

       ShowPicOrig.apply(this, arguments); //call original ShowPic

       //apply some changes to display original picture in SlideShow control
       ssObj.image.src = ssObj.linkArray[curPicIdx]; //display original image instead of web image
       //change picture & container size to auto instead of fixed (by default web image size is used)
         ssObj.image.setAttribute('height','100%'); 
         ssObj.image.setAttribute('width','100%'); 


         var cell = ssObj.cell; 
         cell.style.width = 'auto';
         cell.style.height = 'auto';
         cell.style.display = '';
         var pcell = ssObj.cell.parentNode; 
       pcell.style.width = 'auto';
         pcell.style.height = 'auto';
  };  })(ShowPic);    } 
ExecuteOrDelayUntilScriptLoaded(SlideshowObjectInitializer, 'imglib.js');
</script>
  • I think you need a URL Associated with every image of the slideshow.Try to see if ssObj has any "EncodedAbsUrl" property. You can follow up article which mentioned how you can retrieve all the Links associated with Images in slide show in function "loadPicturesInfo" blog.vgrem.com/2013/04/27/… – vinit kumar Jan 14 '19 at 13:06
  • Thanks Vinit, it was such an old article and the suggestion was to post here that I did. I've added to the comments now anyway. Also, I've no idea how to do what you suggest, sorry :) – Chris Sandiford Jan 14 '19 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.