-
- 20 Posts
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!
-
- 24,544 Posts
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);.
https://bobsguides.com/redirecting-users-on-login-ii.html
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.
-
- 932 Posts
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:
[[++openingHours:formatSnippet]]