Open sympmarc opened 5 years ago
Thank you @sympmarc for sharing this! Actually, it is a good timing to speak about this because I was currently thinking about the template feature in this Web Part and how we could improve it. These are my thoughts and it is all about Office UI Fabric ;)
Basically, with the Office UI Fabric evolution (a very good explanation by @AndrewConnell BTW), if you want to use Office UI Fabric to get a nice UI that fit with Office 365 styles, you basically have no other choice than to use React components, which is, for a solution based on Handlebars, pretty much not compatible I would say ;)...To deal with this, you can do what you did, by 'rewriting' the Office UI Fabric CSS to get the same styles or go with a full custom CSS (not even SASS) in the '
Category
I've been working on a Handlebars template to display modern events. It's still WIP, but I wanted to share it here for discussion. It might make sense to offer some additional templates like this for known Content Types.
There are challenges here with formatting. I've stolen the markup for the Events Web Part as a starting point and layered in the Handlebars magic to handle the variations. I may not have covered all of them.
For this to be standalone, we'll need to replicate the look and feel with custom CSS in the
/* Insert your CSS here */
section. All of the transpiled classes below (cardWrapper_0eb586b0 compactCard_0eb586b0 compactCard-258
, etc.) need to be replaced with custom CSS, which basically takes us "off brand". This isn't a great approach, so I'm curious what ideas others might have.Query Template
Could be anything, but in my case, I'm doing something like this (for an example):
DepartmentId:{{PageContext.hubSiteId}} ContentType:Event (RefinableCampus:{{User.CustomCampus.Name}} OR RefinableCampus:'All')
Selected Properties
ListItemId,ListId,Title,EventDateOWSDATE,EndDateOWSDATE,IsAllDayEvent,Path
Handlebars template
@dcashpeterson