Sep 12 2021 01:33 AM - edited Sep 12 2021 01:35 AM
Hello,
Preface: I am a SharePoint novice having only moved to the platform this year...
I have a list containing a 'person' column (titled 'Staff Email') populated with the staff members at our school. I am embedding the list in gallery view to a SharePoint page.
However, in Tile view I would like to increase the size of the user thumbnail.
With some trial and error amending the JSON data in advanced mode (bearing in mind I am a novice, and trial and error is all I have at my disposal) I have found that I need to remove "class": "sp-card-userThumbnail" [Line 58] to cause any change at all. But how do I increase the size of the circular thumbnail that is displayed?
"formatter": {
"elmType": "div",
"attributes": {
"class": "sp-card-container"
},
"children": [
{
"elmType": "button",
"attributes": {
"class": "sp-card-defaultClickButton",
"role": "presentation"
},
"customRowAction": {
"action": "defaultClick"
}
},
{
"elmType": "div",
"attributes": {
"class": "ms-bgColor-white sp-css-borderColor-neutralLight sp-card-borderHighlight sp-card-subContainer"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "sp-card-previewColumnContainer"
},
"children": [
{
"elmType": "div",
"style": {
"display": "flex"
},
"children": [
{
"elmType": "p",
"attributes": {
"class": "sp-card-userEmptyText"
},
"txtContent": "=if(length([$StaffEmail]) == 0, '–', '')"
},
{
"forEach": "personIterator in [$StaffEmail]",
"elmType": "a",
"attributes": {
"class": "=if(loopIndex('personIterator') >= 5, 'sp-card-userContainer', 'sp-card-userContainer sp-card-keyboard-focusable')"
},
"style": {
"display": "=if(loopIndex('personIterator') >= 5, 'none', '')"
},
"children": [
{
"elmType": "img",
"defaultHoverField": "[$personIterator]",
"attributes": {
"src": "=getUserImage([$personIterator.email], 'S')",
"title": "[$personIterator.title]",
"class": "sp-card-userThumbnail"
},
"style": {
"display": "=if(length([$StaffEmail]) > 5 && loopIndex('personIterator') >= 4, 'none', '')"
}
},
{
"elmType": "div",
"attributes": {
"class": "ms-bgColor-neutralLight ms-fontColor-neutralSecondary sp-card-userOthers"
},
"style": {
"display": "=if(length([$StaffEmail]) > 5 && loopIndex('personIterator') == 4, '', 'none')"
},
"customCardProps": {
"formatter": {
"elmType": "div",
"attributes": {
"class": "sp-card-personCallout"
},
"children": [
{
"forEach": "personIterator in [$StaffEmail]",
"elmType": "div",
"attributes": {
"class": "sp-card-userContainer sp-card-userCustomCard"
},
"style": {
"display": "=if(loopIndex('personIterator') < 4, 'none', '')"
},
"children": [
{
"elmType": "img",
"defaultHoverField": "[$personIterator]",
"attributes": {
"src": "=getUserImage([$personIterator.email], 'S')",
"title": "[$personIterator.title]",
"class": "sp-card-userThumbnail"
}
}
]
}
]
},
"openOnEvent": "hover"
},
"children": [
{
"elmType": "span",
"txtContent": "='+' + toString(length([$StaffEmail]) - (4))"
}
]
}
]
},
{
"elmType": "div",
"attributes": {
"class": "sp-card-userTitle"
},
"style": {
"display": "=if(length([$StaffEmail]) == 1, '', 'none')"
},
"defaultHoverField": "[$personIterator]",
"txtContent": "[$StaffEmail.title]"
}
]
}
]
},
Nov 09 2022 06:48 PM
Nov 09 2022 07:50 PM
@Sourceress @Ramikin You can try using different thumbnail sizes in src property of img element like:
"src":"=getUserImage([$personIterator.email], 'medium')"
OR
"src":"=getUserImage([$personIterator.email], 'large')"
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.