Embed SharePoint modern list to classic publishing page

Brass Contributor

I have embedded a SharePoint list (set to modern experience) to a classic publishing page on one of our site collection's. Once embedded, the list view web part is in classic expereince. 

 

Is there any way to:

1. Display a date column (Modified column) in friendly format - e.g. 1 hour ago, rather than 27/07/2022 15:22?

2. Add any JS that conditionally formats each row? e.g. if status = red, the whole row is highlighted red

 

Please note that I am aware this is possible in modern experience but for various reasons, we are unable to change this page to modern at the moment. 

 

Thanks

4 Replies
I am not sure if you can do JSON conditional formatting in classic view. It is only applicable when the page is rendered in Modern UI. You may need to use Javascript or some client side scripting to render content on your classic page.

@Bharath Arja JSON formatting will not work in classic experience.


@Sam1209 how are you embedding the modern list on classic page, using which web part?

 

If list is loaded in classic experience, you have to use the JSLink (client side rendering) for applying any custom formatting on list column. See few examples at: Client Side Rendering: List Views 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap Correct, JSON formatting only renders in Modern UI. That’s what I mentioned in my response. 

@Bharath Arja Yes, I know. You said you are not sure whether it will work in classic experience. So, I just confirmed that it will not work in classic experience.


Please consider giving a Like if my post helped you in any way.