Hi, I was wondering what are people's prefered methods for entering business hours? I love ClientConfig, but it's TV types are limited. Do people prefer Date, MIGX tables, or something else? I'm trying to populate the meta tags in my header properly, but am unsure the best practice. Thanks, and happy holidays!
I'm not sure if you'll find this helpful or not, but it's one approach. It redirects the user on login, but it could easily be a snippet that sets a placeholder for use in the template's meta tag with $modx->setPlaceholder('placeholderName', $value);.
The values for $open and $close could come from System Setting(s), but it's faster to just put them in the code of the snippet. That also allows some automatic calculations to be made for weekends, holidays, etc.
I would not use TVs for this, BTW, since the value needs to be available throughout the site. TVs are intended for resource-specific data and are inefficient when used for anything else.
Is the meta just a schema.org variant? ie:
<time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time>
If so then clientconfig should be fine, which is essentially just a system setting. You may need to create a snippet though to give the formatted date outputs you need but you can just tack that on to your setting ie:
■ email: email@example.com | ■ website: https://alienbuild.uk
The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk
about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.