How to Preview SharePoint Site Pages Without Opening Them
Let’s be honest – managing a Site Pages library with hundreds of pages is a real pain. You know the drill: click, wait, scroll, realize it’s the wrong page, go back, repeat.
I’ve been there, and I’m sure you have too. Opening several pages just to find the right one is time-consuming and frankly, pretty frustrating. There’s actually a way to preview pages directly in the library without ever leaving it.
This little trick could save you hours of hunting through pages, and honestly, it’s one of those “why didn’t I think of this sooner” moments.
The Lightbulb Moment
I’ve had this idea brewing since I wrote about customRowAction to embed content (if you’re not familiar with it, you can learn more about it here). But here’s the thing – this feature only works in the new Microsoft Lists application, not across all SharePoint interfaces!
This week, when I saw a post from Microsoft Lists legend Tetsuya Kawahara about formatting to preview files in document libraries. I immediately got excited and went to test the formatting I already had in place for pages preview.
Plot twist: Tetsuya even mentioned that his formatting doesn’t work with Site Pages!
That’s when I had my “aha” moment – I tried opening the Site Pages in Microsoft Lists instead. And suddenly, the preview for pages started working perfectly.
Here’s How to Make the Magic Happen
Here’s the step-by-step breakdown to transform your Site Pages experience:
- Navigate to your Site Pages library on your SharePoint site collection
- Create a new column called “Preview” – the column type doesn’t really matter since it won’t contain actual content. I used single line of text for simplicity
- Open the context menu on your new column, then click “Format this column” under Column Settings
- Paste the following JSON formatting into the column (make sure to replace contoso.sharepoint.com with your own tenant URL):
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "children": [ { "elmType": "div", "style": { "border-radius": "50%", "cursor": "pointer", "font-size": "15px", "width": "27px", "height": "27px", "display": "flex", "justify-content": "center", "align-items": "center", "font-weight": "bold" }, "attributes": { "class": "ms-bgColor-themeLighter ms-bgColor-themePrimary--hover ms-fontColor-neutralPrimary ms-fontColor-white--hover", "iconName": "View" }, "customRowAction": { "action": "embed", "actionInput": { "src": { "operator": "+", "operands": [ "https://contoso.sharepoint.com/", "[$FileRef]", "?env=WebView" ] }, "height": "=@window.innerHeight*0.7", "width": "=@window.innerWidth*0.5" } } } ] }
- Save your changes
At this point, you should see the formatting appear, but clicking the eye icon won’t do anything yet. Don’t worry – we’re not done!
- Here’s the secret sauce: Add this query string to your Site Pages list URL: ?env=WebViewList
- You’ll now see your Site Pages library in the Microsoft Lists application interface
- Click that eye icon and boom – the page preview appears in a popup!
The Reality Check
This isn’t the most intuitive workaround, but it works like a charm.
You can bookmark the URL with the query string or add it to a Quick Links web part that only you can see. Think of it as your secret productivity weapon.
Making the Site Pages library more functional is something I’ve been working on for some time. You can learn more about how to customize the site pages experience in my following articles:
No comments yet