SharePoint List - Gallery View - open directly

Martin, Heidi (SE GP T SP PS) 571 Reputation points
2023-08-11T08:38:07.1133333+00:00

Hello, Is it possible that clicking on the whole map (or on the image) opens the respective link? At the moment only the single element opens.

User's image

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
{count} votes

Accepted answer
  1. Yanli Jiang - MSFT 31,561 Reputation points Microsoft External Staff
    2023-08-16T08:46:20.3566667+00:00

    Hi @Martin, Heidi (SE GP T SP PS) ,

    You can try this:

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
      "hideSelection": true,
      "formatter": {
        "elmType": "div",
        "children": [
          {
            "elmType": "a",
            "style": {
              "position": "absolute"
            },
            "attributes": {
              "target": "_blank",
              "href": "[$Link]"
            },
            "children": [
              {
                "elmType": "img",
                "attributes": {
                  "src": "[$Picturelink]"
                },
                "style": {
                  "height": "200px",
                  "width": "200px"
                }
              }
            ]
          },
          {
            "elmType": "div",
            "style": {
              "width": "300px",
              "height": "10px",
              "padding-top": "250px"
            },
            "children": [
              {
                "elmType": "span",
                "txtContent": "[$Title]",
                "style": {
                  "width": "30px",
                  "height": "10px"
                }
              }
            ]
          }
        ]
      }
    }
    

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.


1 additional answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 31,561 Reputation points Microsoft External Staff
    2023-08-14T09:27:27.0733333+00:00

    Hi @Martin, Heidi (SE GP T SP PS) ,

    First of all, please allow me to confirm with you, do you want to jump when you click on the entire image? If yes, you can refer to the method:

    This is the list I used to test:

    08141

    This is the JSON code used to view formatting:

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
      "hideSelection": true,
      "width": "100px",
      "height": "100px",
      "formatter": {
        "elmType": "div",
        "children": [
          {
            "elmType": "a",
            "style": {
              "position": "absolute"
            },
            "attributes": {
              "target": "_blank",
              "href": "[$Link]"
            },
            "children": [
              {
                "elmType": "img",
                "attributes": {
                  "src": "[$Picturelink]"
                },
                "style": {
                  "height": "300px",
                  "width": "300px"
                }
              }
            ]
          }
        ]
      }
    }
    

    This is the result:

    08142

    Or, your requirement is to click the icon in the picture, and then you will jump to the corresponding link?

    08143

    If yes, this is customization. The Q&A forum is currently dedicated to troubleshooting. For customization services, I suggest you go to the Partner Center to obtain the corresponding services.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.