SharePoint Server 2016: How to set URL for each image in a picture library slideshow

Mike Bison 21 Reputation points

Hi guys,
On my SharePoint 2016 site, I created a picture library with a few pictures, and then my site home page has a picture library slideshow web part that uses the pictures in this library.

I've been asked for one specific image in the web part to link to a totally separate document on the site when the image is clicked. The default behavior when clicking the images is that they take the user to the image's URL, so for one image in the slideshow I need to overwrite that with a different hyperlink.

I'm comfortable with adding code to a CEWP and customizing it as needed, but am really bad at writing my own code, so this is where I'm hoping someone here can help by sharing the code I need to use for this task. THANK YOU!

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,147 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,558 questions
0 comments No comments
{count} votes

Accepted answer
  1. Baker Kong-MSFT 3,791 Reputation points

    Hi @Mike Bison ,

    Try this code:

    Test Result:


    Best Regards,
    Baker Kong

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

2 additional answers

Sort by: Most helpful
  1. Mike Bison 21 Reputation points

    Thanks, this looks like exactly what I need! I haven't had a chance to test yet because work got really busy but I've marked this as the answer and will let you know if I have any issues implementing. Thank you so much, appreciate the fast response and friendly support!

    P.S. - nice hot chicks in the photos, well played :)

    0 comments No comments

  2. Filho, Pedro Leno dos Reis 0 Reputation points

    Bom dia.

     Suplico uma ajuda. Estou com o mesmo problema preciso criar um carrossel, onde ao ser clicar em uma imagem eu possa direcionar para um link qualquer.
    Porém não consegui compreender como insiro o código, sou leigo por aqui, e suplico uma ajuda.

    Good morning.

     I ask for help. I have the same problem I need to create a carousel, where when I click on an image I can direct to any link. But I couldn't understand how I insert the code, I'm a layman around here, and I beg for help.

    User's image

    User's image

    Em qual destes Ícones eu consigo incluir o seu código.

    In which of these Icons can I include your code.

    User's image

    0 comments No comments