Jul 27 2022 08:24 AM - edited Jul 27 2022 08:24 AM
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
Jul 27 2022 10:18 AM
Jul 28 2022 12:36 AM
@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.
Jul 28 2022 03:34 AM
@ganeshsanap Correct, JSON formatting only renders in Modern UI. That’s what I mentioned in my response.
Jul 28 2022 04:03 AM
@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.