Skip to content

Commit d36c465

Browse files
authored
Added created-modified-footer (pnp#869)
* Added created-modified-footer * Updated sample.json
1 parent 3416703 commit d36c465

File tree

4 files changed

+248
-0
lines changed

4 files changed

+248
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Display Created and Modified Information in the Footer
2+
3+
## Summary
4+
5+
This sample demonstrates displaying the values of "Created" (internal name: `Created`), "Created By" (internal name: `Author`), "Modified" (internal name: `Modified`), and "Modified By" (internal name: `Editor`) in the footer of the form.
6+
7+
![screenshot of the sample](./assets/screenshot.png)
8+
9+
## Form requirements
10+
11+
None
12+
13+
## Sample
14+
15+
Solution|Author(s)
16+
--------|---------
17+
created-modified-footer.json | [Tetsuya Kawahara](https://github.com/tecchan1107) ([@techan_k](https://twitter.com/techan_k))
18+
19+
## Version history
20+
21+
Version |Date |Comments
22+
--------|-----------------|--------
23+
1.0 |October 27, 2024 |Initial release
24+
25+
## Disclaimer
26+
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
27+
28+
<img src="https://pnptelemetry.azurewebsites.net/list-formatting/form-samples/created-modified-footer" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
[
2+
{
3+
"name": "pnp-list-formatting-created-modified-footer",
4+
"reponame": "created-modified-footer",
5+
"source": "pnp",
6+
"title": "Display Created and Modified Information in the Footer",
7+
"shortDescription": "This sample demonstrates displaying the values of Created, Created By, Modified, and Modified By in the footer of the form.",
8+
"url": "https://github.com/pnp/List-Formatting/tree/master/form-samples/created-modified-footer",
9+
"longDescription": [
10+
"This sample demonstrates displaying the values of Created, Created By, Modified, and Modified By in the footer of the form."
11+
],
12+
"creationDateTime": "2024-10-27T00:00:00.000Z",
13+
"updateDateTime": "2024-10-27T00:00:00.000Z",
14+
"products": [
15+
"SharePoint",
16+
"Microsoft Lists"
17+
],
18+
"metadata": [
19+
{
20+
"key": "LIST-SAMPLE-TYPE",
21+
"value": "Form"
22+
},
23+
{
24+
"key": "SHAREPOINT-COMPATIBILITY",
25+
"value": "SharePoint Online"
26+
},
27+
{
28+
"key": "SAMPLE-CATEGORIES",
29+
"value": ""
30+
},
31+
{
32+
"key": "LIST-COLUMN-TYPE",
33+
"value": ""
34+
},
35+
{
36+
"key": "FORMATTING-TOKENS",
37+
"value": ""
38+
},
39+
{
40+
"key": "FORMATTING-OPERATORS",
41+
"value": "getUserImage"
42+
},
43+
{
44+
"key": "FORMATTING-ACTIONS",
45+
"value": ""
46+
},
47+
{
48+
"key": "FORMATTING-FEATURES",
49+
"value": ""
50+
},
51+
{
52+
"key": "CLASSES",
53+
"value": "ms-bgColor-neutralLight, ms-fontColor-neutralPrimary, ms-fontSize-s"
54+
}
55+
],
56+
"thumbnails": [
57+
{
58+
"type": "image",
59+
"order": 100,
60+
"url": "https://raw.githubusercontent.com/pnp/List-Formatting/master/form-samples/created-modified-footer/assets/screenshot.png",
61+
"alt": "screenshot"
62+
}
63+
],
64+
"authors": [
65+
{
66+
"gitHubAccount": "tecchan1107",
67+
"pictureUrl": "https://github.com/tecchan1107.png",
68+
"name": "Tetsuya Kawahara"
69+
}
70+
],
71+
"references": [
72+
{
73+
"name": "Configure the list form",
74+
"description": "You can configure the list form in a list or library with a custom header, footer and the form body with one or more sections with fields in each of those sections.",
75+
"url": "https://docs.microsoft.com/sharepoint/dev/declarative-customization/list-form-configuration"
76+
},
77+
{
78+
"name": "Show or hide columns in a list or library form",
79+
"description": "You can show or hide columns in a list or library form as an alternative to deleting them. When you hide a column, it doesn\u0027t affect the column or the data in the column, as it would if you delete it.",
80+
"url": "https://docs.microsoft.com/sharepoint/dev/declarative-customization/list-form-conditional-show-hide"
81+
}
82+
]
83+
}
84+
]
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"elmType": "div",
3+
"children": [
4+
{
5+
"elmType": "div",
6+
"style": {
7+
"display": "=if([$ID],'flex','none')",
8+
"flex-direction": "column",
9+
"margin-top": "10px",
10+
"margin-bottom": "10px"
11+
},
12+
"attributes": {
13+
"class": "ms-fontSize-s"
14+
},
15+
"children": [
16+
{
17+
"elmType": "div",
18+
"style": {
19+
"display": "flex",
20+
"flex-direction": "row",
21+
"align-items": "center",
22+
"white-space": "nowrap",
23+
"column-gap": "3px"
24+
},
25+
"children": [
26+
{
27+
"elmType": "span",
28+
"txtContent": "Created at"
29+
},
30+
{
31+
"elmType": "span",
32+
"txtContent": "[$Created]"
33+
},
34+
{
35+
"elmType": "span",
36+
"txtContent": "by"
37+
},
38+
{
39+
"elmType": "div",
40+
"style": {
41+
"display": "flex",
42+
"flex-direction": "row",
43+
"align-items": "center",
44+
"white-space": "nowrap",
45+
"border-radius": "14px"
46+
},
47+
"attributes": {
48+
"class": "ms-bgColor-neutralLight ms-fontColor-neutralPrimary"
49+
},
50+
"children": [
51+
{
52+
"elmType": "img",
53+
"style": {
54+
"width": "24px",
55+
"height": "24px",
56+
"border-radius": "50%"
57+
},
58+
"attributes": {
59+
"src": "=getUserImage([$Author.email],'small')"
60+
}
61+
},
62+
{
63+
"elmType": "div",
64+
"txtContent": "[$Author.title]",
65+
"style": {
66+
"padding-left": "6px",
67+
"padding-right": "10px"
68+
}
69+
}
70+
]
71+
}
72+
]
73+
},
74+
{
75+
"elmType": "div",
76+
"style": {
77+
"display": "flex",
78+
"flex-direction": "row",
79+
"align-items": "center",
80+
"white-space": "nowrap",
81+
"margin-top": "10px",
82+
"column-gap": "3px"
83+
},
84+
"children": [
85+
{
86+
"elmType": "span",
87+
"txtContent": "Last modified at"
88+
},
89+
{
90+
"elmType": "span",
91+
"txtContent": "[$Modified]"
92+
},
93+
{
94+
"elmType": "span",
95+
"txtContent": "by"
96+
},
97+
{
98+
"elmType": "div",
99+
"style": {
100+
"display": "flex",
101+
"flex-direction": "row",
102+
"align-items": "center",
103+
"white-space": "nowrap",
104+
"border-radius": "14px"
105+
},
106+
"attributes": {
107+
"class": "ms-bgColor-neutralLight ms-fontColor-neutralPrimary"
108+
},
109+
"children": [
110+
{
111+
"elmType": "img",
112+
"style": {
113+
"width": "24px",
114+
"height": "24px",
115+
"border-radius": "50%"
116+
},
117+
"attributes": {
118+
"src": "=getUserImage([$Editor.email],'small')"
119+
}
120+
},
121+
{
122+
"elmType": "div",
123+
"txtContent": "[$Editor.title]",
124+
"style": {
125+
"padding-left": "6px",
126+
"padding-right": "10px"
127+
}
128+
}
129+
]
130+
}
131+
]
132+
}
133+
]
134+
}
135+
]
136+
}

0 commit comments

Comments
 (0)