Skip to content

Commit 5ab5829

Browse files
authored
Formatting docs update (SharePoint#7707)
* Add docs for getThumbnailImage operator * Add docs for board view * Update ms.date * Fix typo
1 parent 67a33d9 commit 5ab5829

File tree

5 files changed

+44
-9
lines changed

5 files changed

+44
-9
lines changed

docs/declarative-customization/formatting-syntax-reference.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Formatting syntax reference
33
description: Formatting syntax reference
4-
ms.date: 01/06/2022
4+
ms.date: 02/09/2022
55
ms.localizationpriority: high
66
---
77

@@ -635,6 +635,8 @@ Operators specify the type of operation to perform. The following operators are
635635
- `"txtContent":"=padEnd('DogFood', 10, 'A')"` results in _DogFoodAAA_
636636
- `"txtContent":"=padEnd('DogFood', 10, 'AB')"` results in _DogFoodABA_
637637
- `"txtContent":"=padEnd('DogFood', 5, 'A')"` results in _DogFood_
638+
- **getThumbnailImage**: returns a URL pointing to image for a given image field and preferred size.
639+
- `"src":"=getThumbnailImage([$ImageField], 400, 200)"` results in a URL pointing to image for a given image field with 400 width and 200 height
638640

639641
**Conditional operator** - The conditional operator is:
640642

@@ -864,7 +866,12 @@ The image field object has the following properties (with example values):
864866
"fileName": "image.png",
865867
"id": "6bb1d843-0633-4c9a-9a16-90bc5abd1d8e",
866868
"serverRelativeUrl": "/teams/Discovery/SiteAssets/Lists/ad6ed939-0db2-4d85-8a39-8f3497f41eee/image.png",
867-
"serverUrl": "https://contoso.sharepoint.com"
869+
"serverUrl": "https://contoso.sharepoint.com",
870+
"thumbnailRenderer": {
871+
"spItemUrl": "https://contoso.sharepoint.com:443/_api/v2.1/drives/b!7196759210defdc0/items/2303b15bfa48c74a74758135a0df1201",
872+
"fileVersion": 3,
873+
"sponsorToken": "3u+UR6n8AgABAAAAHxxdXKmiOmUoqKnZlf8lTOhlPYy93EAkbPfs5+49YLFd/B1+omSKbW7DoqNM40/EeVnwJ8kYoXv9zy9D5C5m5A=="
874+
}
868875
}
869876
```
870877

@@ -875,7 +882,7 @@ The following example shows how an image field can be used on a current field.
875882
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
876883
"elmType": "img",
877884
"attributes": {
878-
"src": "@currentField.serverRelativeUrl",
885+
"src": "=getThumbnailImage(@currentField, 400, 300)",
879886
"alt": "@currentField.fileName"
880887
},
881888
"style": {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Format board view to customize SharePoint
3+
description: Customize how board views in SharePoint lists and libraries are displayed by constructing a JSON object that describes the elements and the styles to be applied to those elements.
4+
ms.date: 02/09/2022
5+
ms.localizationpriority: high
6+
---
7+
8+
# Board view customizations
9+
10+
## Build custom cards
11+
12+
You can use Board **`formatter`** to define a totally custom layout of field values inside a card using the same syntax used in [Column Formatting](column-formatting.md).
13+
14+
## Detailed syntax reference
15+
16+
### hideSelection
17+
18+
Optional element. Specifies whether the ability to select cards in the view is disabled or not. `false` is the default behavior inside a board view (meaning selection is visible and enabled). `true` means that users will not be able to select list items.
19+
20+
### formatter
21+
22+
JSON object that defines the layout of cards. The schema of this JSON object is identical to the schema of a column format (and that of rowFormatter). For details on this schema and its capabilities, see the [Formatting syntax reference](./formatting-syntax-reference.md).
23+
24+
## See also
25+
- [Advanced formatting concepts](./formatting-advanced.md)
26+
- [Formatting syntax reference](./formatting-syntax-reference.md)

docs/declarative-customization/view-formatting.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Use view formatting to customize SharePoint
33
description: Customize how views in SharePoint lists and libraries are displayed by constructing a JSON object that describes the elements that are displayed in a list view, and the styles to be applied to those elements.
4-
ms.date: 10/18/2021
4+
ms.date: 02/09/2022
55
ms.localizationpriority: high
66
---
77

@@ -26,9 +26,9 @@ The pane will look like the following depending on the current layout:
2626
![List layout formatting pane](../images/sp-viewformatting-panel-listlayout.png) ![Gallery layout formatting pane](../images/sp-viewformatting-panel-tileslayout.png)
2727

2828
> [!NOTE]
29-
> We have simplified the View formatting pane experience to separate out the List and Gallery layout formatting JSON. With this change, you do not need to add `tileProps` prop anymore.
29+
> We have simplified the View formatting pane experience to separate out layout specific formatting JSON. With this change, you do not need to add layout specific props like `tileProps` anymore.
3030
31-
To format rows in 'List' or 'Compact List' layout, select 'List' in 'Choose layout' dropdown in the formatting pane and use the `rowFormatter` or `additionalRowClass` properties. To format cards in 'Gallery' layout, select 'Gallery' in 'Choose layout' dropdown in the formatting pane and use the `formatter` property.
31+
To format rows in 'List' or 'Compact List' layout, select 'List' in 'Choose layout' dropdown in the formatting pane and use the `rowFormatter` or `additionalRowClass` properties. To format cards in 'Gallery' layout, select 'Gallery' in 'Choose layout' dropdown in the formatting pane and use the `formatter` property. To format cards in 'Board' view just use the `formatter` property.
3232

3333
The easiest way to use view formatting is to start from an example and edit it to apply to your specific view. The following sections contain examples that you can copy, paste, and customize for your specific needs. There are also several samples available in the [SharePoint/sp-dev-list-formatting repository](https://github.com/SharePoint/sp-dev-list-formatting).
3434

@@ -45,6 +45,7 @@ Creating custom view formatting JSON from scratch is simple if user understands
4545
## See also
4646
- [List layout customization](./view-list-formatting.md)
4747
- [Gallery layout customization](./view-gallery-formatting.md)
48+
- [Board view customization](./view-gallery-formatting.md)
4849
- [Group customization syntax reference](./view-group-formatting.md)
4950
- [Advanced formatting concepts](./formatting-advanced.md)
5051
- [Formatting syntax reference](./formatting-syntax-reference.md)

docs/declarative-customization/view-gallery-formatting.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Format gallery view to customize SharePoint
33
description: Customize how gallery views in SharePoint lists and libraries are displayed by constructing a JSON object that describes the elements and the styles to be applied to those elements.
4-
ms.date: 10/18/2021
4+
ms.date: 02/09/2022
55
ms.localizationpriority: high
66
---
77

@@ -334,8 +334,7 @@ In this example the `@aggregates` array is used to display a summary in the grou
334334

335335
### hideSelection
336336

337-
Optional element. Specifies whether the ability to select rows in the view is disabled or not. `false` is the default behavior inside a list view (meaning selection is visible and enabled). `true` means that users will not be able to select list items.
338-
337+
Optional element. Specifies whether the ability to select cards in the view is disabled or not. `false` is the default behavior inside a gallery view (meaning selection is visible and enabled). `true` means that users will not be able to select list items.
339338
### fillHorizontally
340339

341340
Optional element. Specifies whether the cards in the row should be stretched horizontally to fill the row. `false` is the default behavior (meaning cards in a row are stacked without resizing until they overflow). `true` means cards in the row are stretched horizontally only if necessary to fill the row.

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@
9191
href: declarative-customization/view-list-formatting.md
9292
- name: Gallery layout customization
9393
href: declarative-customization/view-gallery-formatting.md
94+
- name: Board view customization
95+
href: declarative-customization/view-board-formatting.md
9496
- name: Group customization syntax reference
9597
href: declarative-customization/view-group-formatting.md
9698
- name: Forms configuration

0 commit comments

Comments
 (0)