如何使用JSON使我的个人资料图片大小变大?

huangapple go评论48阅读模式
英文:

How to make the size of my profile picture bigger with JSON?

问题

"Width":"72px";
"height":"72px";

但没有成功

英文:

I have set my profile picture in the list column Person. When i go to the Gallery view
i think my profile picture is a little bit small and could get bigger like 72x72.
But what to put in the json code to make my profile picture 72x72 ?

Gr. P

I have tried:
"Width":"72px";
"height""72px"

But no luck

答案1

得分: 0

以下是翻译好的代码:

当创建一个图库时,默认的 `Author` 列的 JSON 格式如下:

"children": [
  {
    "elmType": "p",
    "attributes": {
      "class": "sp-card-userEmptyText"
    },
    "txtContent": "=if(length([$Author]) == 0, '–', '')"
  },
  {
    "forEach": "personIterator in [$Author]",
    "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', '')"
    }
  },
  ...
]

如果你想改变 CSS 样式,你可以将 `width`  `height` 设置为 72px。
在你的图库视图中,点击 `Format current view > Advanced mode` 来编辑 JSON 定义。你可以分享你的代码以便查看问题所在。

"children": [
  {
    "elmType": "p",
    "attributes": {
      "class": "sp-card-userEmptyText"
    },
    "txtContent": "=if(length([$Author]) == 0, '–', '')"
  },
  {
    "forEach": "personIterator in [$Author]",
    "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', '')",
      "width": "72px",
      "height": "72px"
    }
  },
  ...
]

请注意,默认情况下用户的个人资料图片使用 S 大小(小,32px)。你也可以更改 URL 以使用 M 大小(中,72px):检查 `getUserImage` 函数的第二个参数。

"children": [
  {
    "elmType": "img",
    "defaultHoverField": "[$personIterator]",
    "attributes": {
      "src": "=getUserImage([$personIterator.email], 'M')",
      "title": "[$personIterator.title]",
      "class": "sp-card-userThumbnail"
    },
  ...
]
英文:

When creating a gallery, the default JSON formatting for the Author column is:

            "children": [
{
"elmType": "p",
"attributes": {
"class": "sp-card-userEmptyText"
},
"txtContent": "=if(length([$Author]) == 0, '–', '')"
},
{
"forEach": "personIterator in [$Author]",
"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', '')"
},

如何使用JSON使我的个人资料图片大小变大?

If you want to change the CSS, you can add width and height to 72px.
On your gallery view, click on Format current view > Advanced mode to edit the JSON definition. Can you share your code to see what's wrong?

            "children": [
{
"elmType": "p",
"attributes": {
"class": "sp-card-userEmptyText"
},
"txtContent": "=if(length([$Author]) == 0, '–', '')"
},
{
"forEach": "personIterator in [$Author]",
"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', '')",
"width": "72px",
"height": "72px"
},

如何使用JSON使我的个人资料图片大小变大?

Please note that by default the user profile picture is using the S size (small, 32px). You can also change the URL to use the M size (medium, 72px): check the second argument of the getUserImage function.

                "children": [
{
"elmType": "img",
"defaultHoverField": "[$personIterator]",
"attributes": {
"src": "=getUserImage([$personIterator.email], 'M')",
"title": "[$personIterator.title]",
"class": "sp-card-userThumbnail"
},

huangapple
  • 本文由 发表于 2023年7月17日 09:40:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76701067.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定