Forum Discussion

john john's avatar
john john
Steel Contributor
Jul 03, 2019

Unable to set the default rendering as "Tiles" for my document library view

I have created a new sharepoint modern team site, and inside the built-in document library, i want to set the default rendering for all users to be "Titles" instead of "List", as follow:-

 

 

I created a new list view and set the rendering as "Tiles" >> set the new list view as the default view >> which will save the setting for the current user only (office 365 admin). but when other users access the new default list view >> the document library will show the items using the "List" rendering , also if the office 365 admin logout/relogin he will also get the "List" rendering instead of "Tiles".. so is there a way to force the default list view for our document library to always render as "Tiles"? 

Thanks

 

  • RaulPop's avatar
    RaulPop
    Copper Contributor

    john john Please find below my step by step approach to setting the "Tiles" as a default view.

    1. Site Contents - create a new list      (with "Show in site navigation")
    2. Add an new item to the list (at this step the list is made only of the "Title" column).
    3. In the "All Items" drop-down - select "Save view as" - give it a new name. Ensure that "Make this a public view" is ticked.
    4. In the "All Items" drop-down ensure the view with the new name is selected and click "Format current view"
    5. Click 'Advance mode", paste your JSON and click "Save". At this point the view should change to reflect your JSON design. Close the "Format view" section ("x" - right corner).
    6. In the "All Items" drop-down - select "Tiles" (the expected view should be displayed) 
    7. In the "All Items" drop-down - select "Save view as" (keep the same name), just click "Save"
    8. In the "All Items" drop-down - click "Set the current view as default"
    9. The solution -> Click "Save View as" (again with the same name)
    10. Done - the "Tiles" view is set as default
    • Jochen Burkhard's avatar
      Jochen Burkhard
      Copper Contributor

      RaulPop "My JSON? All JSON files I discovered paint ugly rows of color, but not text at all is shown. Please help us all out here. Thank you.

       

      • RaulPop's avatar
        RaulPop
        Copper Contributor

        Jochen Burkhard 

        I’ve adapted the example from https://github.com/pnp/sp-dev-list-formatting/tree/master/view-samples/tile-layout-example-with-image

         

        Site Contents - create a new list (with "Show in site navigation")

        Column Name

        Type

        Title

         

        ItemPrice

        Number

        ItemFeatures

        Multiple lines

        ItemPhoto

        Picture

         

        1. Add an new item to the list, filling each column accordingly
        2. In the "All Items" drop-down - select "Save view as" - give it a new name. Ensure that "Make this a public view" is ticked.
        3. In the "All Items" drop-down ensure the view with the new name is selected and click "Format current view"
        4. Click 'Advance mode", paste the following JSON and click "Save". Close the "Format view" section ("x" - right corner).
        5. In the "new view name" drop-down - select "Tiles" (the new view should be displayed). At this point the view should change to reflect the new JSON design.
        6. In the ""new view name" " drop-down - select "Save view as" (keep the same name), just click "Save"
        7. In the " new view name " drop-down - click "Set the current view as default"
        8. The solution -> Click "Save View as" (again with the same name)
        9. Done - the "Tiles" view is set as default
        {
          "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
          "tileProps": {
            "height": "450",
            "width": "300",
            "formatter": {
              "elmType": "div",
              "style": {
                "display": "flex",
                "align-items": "stretch",
                "margin-bottom": "16px",
                "min-width": "150px",
                "flex-grow": "1",
                "justify-content": "space-around",
                "padding": "8px",
                "color": "#333333"
              },
              "children": [
                {
                  "elmType": "div",
                  "style": {
                    "width": "95%",
                    "height": "98%",
                    "box-shadow": "0px 1.6px 3.6px 0 #00000024, 0px 0.3px 0.9px 0 #00000024",
                    "overflow": "hidden",
                    "border-radius": "2px"
                  },
                  "attributes": {
                    "class": "ms-bgColor-neutralLighterAlt"
                  },
                  "children": [
                    {
                      "elmType": "div",
                      "style": {
                        "display": "inline-block",
                        "min-width": "300px"
                      },
                      "children": [
                        {
                          "elmType": "img",
                          "attributes": {
                            "src": "=if([$ItemPicture] == '', @currentWeb + '/_layouts/15/userphoto.aspx?size=M', [$ItemPicture])",
                            "title": "=if([$ItemPicture] == '', 'No picture available', [$Picture.desc])"
                          },
                          "style": {
                            "width": "100%",
                            "height": "200px"
                          }
                        }
                      ]
                    },
                    {
                      "elmType": "div",
                      "style": {
                        "display": "inline-block",
                        "min-width": "300px",
                        "vertical-align": "top",
                        "padding-left": "16px",
                        "padding-top": "16px"
                      },
                      "children": [
                        {
                          "elmType": "div",
                          "style": {
                            "color": "#767676",
                            "font-size": "12px"
                          },
                          "txtContent": "Product"
                        },
                        {
                          "elmType": "div",
                          "style": {
                            "margin-bottom": "12px",
                            "font-size": "16px",
                            "font-weight": "600"
                          },
                          "txtContent": "[$Title]"
                        },
                        {
                          "elmType": "div",
                          "txtContent": "Price",
                          "style": {
                            "color": "#767676",
                            "font-size": "12px",
                            "margin-bottom": "2px"
                          }
                        },
                        {
                          "elmType": "div",
                          "style": {
                            "font-size": "14px",
                            "margin-bottom": "12px"
                          },
                          "txtContent": {
                            "operator": "+",
                            "operands": [
                              "$",
                              "",
                              "[$ItemPrice]"
                            ]
                          }
                        },
                        {
                          "elmType": "div",
                          "txtContent": "Features",
                          "style": {
                            "color": "#767676",
                            "font-size": "12px",
                            "margin-bottom": "2px"
                          }
                        },
                        {
                          "elmType": "div",
                          "style": {
                            "font-size": "14px",
                            "margin-bottom": "10px",
                            "width": "235px",
                            "height": "70px"
                          },
                          "txtContent": "[$ItemFeatures]"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          }
        }
  • Shijuraj's avatar
    Shijuraj
    Brass Contributor

    john john

    By default the document libraries have only 1 view which is the "All Items" view. From the modern list view you have the option to change the rendering. To always render the document in tile view.

    #1. Change the view to Tile View, and select the option to "save this view as"

    #2. After saving the view, you will get the option to "set current view as the default"

    • john john's avatar
      john john
      Steel Contributor

      Shijuraj  your steps are exactly the same steps which i followed, and which did not work!!.. As if other users access the new defualt view the list view will be rendered using the "List" and not "Tiles",, seems the defualt rendering for the default or custom views will always be "List" and this can not be changed.. maybe MS need to consider this feature..

      • Shijuraj's avatar
        Shijuraj
        Brass Contributor

        John John just now noticed in list settings, still the default view didn't set. Try to set it and see.

         

  • Juan_PCA's avatar
    Juan_PCA
    Copper Contributor

    john john 

     

    Same problem here, from what I've read this behavior is a known issue and it will be addressed on "Summer 2020". But if somebody found a trick to make it work, please share.

    • Midhun's avatar
      Midhun
      Copper Contributor
      It's after the summer, has anyone heard anything? We're still waiting for this...

Resources