We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54732
    • 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!
      • 3749
      • 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.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 17301
        • 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]] 
          ■ email: [email protected] | ■ 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.