Back to view formats
View formattingSharePoint Online

In Memoriam Tiles

This is a silly sample that shows tombstones for items. It demonstrates custom date formatting, custom tiles (gallery) layout, and safe local image referencing.

In Memoriam Tiles formatting preview
Sample preview · View original image

Copy. Apply. Make it yours.

Get this format

1 definition

Review the requirements below, then paste this JSON into the matching formatting panel. Show me where.

Use your list's internal column names and replace any tenant-specific URLs or flow IDs. Formatting is presentation, not a way to secure data.

View formatting
Download JSON
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/view-formatting.schema.json",
  "tileProps": {
    "width": "456",
    "height": "600",
    "formatter": {
      "elmType": "div",
      "children": [
        {
          "elmType": "img",
          "attributes": {
            "src": "=@currentWeb + '/Shared Documents/tombstone.png'"
          }
        },
        {
          "elmType": "div",
          "style": {
            "position": "absolute",
            "left": "0",
            "right": "0",
            "top": "120px",
            "text-align": "center"
          },
          "children": [
            {
              "elmType": "div",
              "txtContent": "[$Title]",
              "style": {
                "font-size": "40px",
                "font-weight": "bold"
              }
            },
            {
              "elmType": "div",
              "txtContent": "=if(getMonth([$Born])==0,'Jan.',if(getMonth([$Born])==1,'Feb.',if(getMonth([$Born])==2,'Mar.',if(getMonth([$Born])==3,'Apr.',if(getMonth([$Born])==4,'May',if(getMonth([$Born])==5,'Jun.',if(getMonth([$Born])==6,'Jul.',if(getMonth([$Born])==7,'Aug.',if(getMonth([$Born])==8,'Sept.',if(getMonth([$Born])==9,'Oct.',if(getMonth([$Born])==10,'Nov.','Dec.'))))))))))) + ' ' + getDate([$Born]) + ', ' + getYear([$Born]) + ' -'",
              "style": {
                "font-size": "32px",
                "font-weight": "bold",
                "padding-top": "40px"
              }
            },
            {
              "elmType": "div",
              "txtContent": "=if(getMonth([$Died])==0,'Jan.',if(getMonth([$Died])==1,'Feb.',if(getMonth([$Died])==2,'Mar.',if(getMonth([$Died])==3,'Apr.',if(getMonth([$Died])==4,'May',if(getMonth([$Died])==5,'Jun.',if(getMonth([$Died])==6,'Jul.',if(getMonth([$Died])==7,'Aug.',if(getMonth([$Died])==8,'Sept.',if(getMonth([$Died])==9,'Oct.',if(getMonth([$Died])==10,'Nov.','Dec.'))))))))))) + ' ' + getDate([$Died]) + ', ' + getYear([$Died])",
              "style": {
                "font-size": "32px",
                "font-weight": "bold"
              }
            },
            {
              "elmType": "div",
              "txtContent": "[$Cause]",
              "style": {
                "font-size": "36px",
                "font-weight": "bold",
                "font-style": "italic",
                "padding": "60px"
              }
            }
          ]
        }
      ]
    }
  }
}

From the contributor

How to use this sample

Summary

This is a silly sample that shows tombstones for items. It demonstrates custom date formatting, custom tiles (gallery) layout, and safe local image referencing.

screenshot of the sample

View requirements

Type Internal Name Required
Single line of text Title Yes
Single line of text Cause Yes
Date/Time Born Yes
Date/Time Died Yes

Sample

Solution Author(s)
in-memoriam-tiles.json Chris Kent

Version history

Version Date Comments
1.0 November 12, 2020 Initial release

Disclaimer

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.


Additional notes

None