In SharePoint online i created a document library. In the new experience view you have the possibility to show the list with a tiles view.
is it possible to do it as a default view? If i make a view the tiles setting is not saved
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI don't think we have that feature yet to save tile view as default.
You can check the changes made to tile view and try to create similar custom view. That might help.
When creating a view (or editing one) you set the Style property to Document Details. As with every View, you can set this one as the default view.
Proof of concept (video): https://drive.google.com/file/d/0B5K0Tsrp16dlVExzS3YwZl9EXzA/view
Use Format View works great and add this json:
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": true,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "a",
"attributes": {
"class": "ms-borderColor-neutralLight",
"href": "[$FileRef]"
},
"style": {
"float": "left"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "ms-bgColor-themeLighterAlt ms-bgColor-themePrimary--hover ms-fontColor-white--hover"
},
"style": {
"display": "flex",
"flex-wrap": "wrap",
"flex-direction": "column",
"align-items": "stretch",
"padding": "1px",
"margin": "10px",
"max-width": "930px",
"box-shadow": "2px 2px 4px darkgrey"
},
"children": [
{
"elmType": "img",
"attributes": {
"src": "[$FileRef]"
},
"style": {
"width": "200px",
"height": "200px"
},
"children": [
{
"elmType": "span",
"txtContent": "[$FileName]",
"style": {
"margin-bottom": "1px"
},
"attributes": {
"class": "ms-fontSize-m ms-fontWeight-regular ms-fontColor-neutralSecondary"
}
}
]
}
]
}
]
}
}
Hi hikmatune and Julian Kulker,
I had a similar requirement in SharePoint Online Modern document library. using Hikmatune's code with two changes I got something that is OK for what I need and may help others. I added the missing } at the end of the code AND removed the 200px height constraint which caused photos to stretch and look silly.
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": true,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "a",
"attributes": {
"class": "ms-borderColor-neutralLight",
"href": "[$FileRef]"
},
"style": {
"float": "left"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "ms-bgColor-themeLighterAlt ms-bgColor-themePrimary--hover ms-fontColor-white--hover"
},
"style": {
"display": "flex",
"flex-wrap": "wrap",
"flex-direction": "column",
"align-items": "stretch",
"padding": "1px",
"margin": "10px",
"max-width": "930px",
"box-shadow": "2px 2px 4px darkgrey"
},
"children": [
{
"elmType": "img",
"attributes": {
"src": "[$FileRef]"
},
"style": {
"width": "200px"
},
"children": [
{
"elmType": "span",
"txtContent": "[$FileName]",
"style": {
"margin-bottom": "1px"
},
"attributes": {
"class": "ms-fontSize-m ms-fontWeight-regular ms-fontColor-neutralSecondary"
}
}
]
}
]
}
]
}
}
This works for what we require. A better solution would be to have Microsoft allow us to have a URL parameter to set "Tiled view" and or allow "Tiled View" be remembered / held by the default view chosen by the library owner. Hope this helps others with this issue. Dorje
This now seems to be possible out of the box with SharePoint Online.
Tested in our tenant with a user who had previously worked on the library and another user who had not seen the library, yet. This worked for both use-cases. YMMV
(Sorry for necroposting. This is the post that Bing AI listed as a solution for this problem when I was researching.)