0

I copied a format code for my list (see below). I had to copy it in list view then change into gallery view. It changes my list view into tiles (see added picture) and it almost works. BUT when I use the list in gallery view on a sharepoint page it will initially shows the tiles but when I save the page it jumps back to list view :-(. How can I save my view with the tiles in gallery view ?

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
  "hideSelection": true,
  "width": "180",
  "height": "150",
  "formatter": {
    "elmType": "a",
    "attributes": {
      "href": "[$URL]",
      "target": "=if([$NewTab] == true, '_blank', '')"
    },
    "children": [
      {
        "elmType": "div",
        "attributes": {
          "class": "ms-bgColor-black ms-bgColor-themePrimary--hover ms-fontColor-white--hover"
        },
        "style": {
          "display": "flex",
          "flex-wrap": "wrap",
          "min-width": "180px",
          "min-height": "150px",
          "margin-right": "10px",
          "margin-top": "10px",
          "box-shadow": "2px 2px 4px black"
        },
        "children": [
          {
            "elmType": "div",
            "style": {
              "text-align": "center",
              "margin": "auto"
            },
            "children": [
              {
                "elmType": "div",
                "attributes": {
                  "class": "sp-row-title "
                },
                "txtContent": "[$Title]"
              },
              {
                "elmType": "div",
                "attributes": {
                  "iconName": "[$Icon]",
                  "class": "ms-fontSize-su"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

Format a list view as tiles with a link inside divided over the whole sharepoint page when switch into gallery view . Everything work except when I save the page it will jumps right back to list view instead of gallery view.

Eva
  • 1
  • 1
  • 1
    i found the solution:If you remove the two lines of code for the customRowAction section, replace "button" with "a" and then add the following two lines of code below "role": "presentation", it should work. Just replace [@Place] with the name of your field that is the hyperlink. "href": "[$Place]", "target": "_blank" – Eva Mar 16 '23 at 15:04
  • Feel free to add that comment as an answer below! – Feathercrown Mar 16 '23 at 20:02

0 Answers0