Back to view formats
View formattingSharePoint Online

photo-gallery-with-likes

This sample demonstrates formatting a document library gallery view into a photo gallery showing title and likes.

photo-gallery-with-likes formatting preview
Sample preview · View original animation

Copy. Apply. Make it yours.

Get this format

2 definitions

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.

From the contributor

How to use this sample

Summary

This sample demonstrates formatting a document library gallery view into a photo gallery showing title and likes.

screenshot of the sample

There is also a version that has no title and shows only likes.

screenshot of the sample

View requirements

The view must be set to gallery.
This format expects the following columns to be part of the view:

Type Internal Name Required
Single line of text Title No
Number LikesTotal No
Multi-Person LikedBy No

Sample

Solution Author(s)
photo-gallery-with-likes.json Lou-i3
photo-gallery-no-title.json Lou-i3

Version history

Version Date Comments
1.0 October 21, 2022 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

The file name can also be displayed by setting the txtContent property as follows.

"txtContent": "=substring('[$FileLeafRef]',0,lastIndexOf([$FileLeafRef],'.'))"