ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to describe office hours

September 09, 2011 11:32pm

Subscribe [4]
  • #1 / Sep 09, 2011 11:32pm

    imjared

    23 posts

    Every once in a while, I’ll come across something that just completely stumps me. I’m not sure if I’m making this more complicated than it needs to be but I wanted to throw it out here for minds greater than my own.

    I’m looking to display office hours for various offices. What this could look like is the following:
    M-F: 9:00 a.m.-5:00 p.m.

    but it could also be something like
    M, W, F: 9:00 a.m. - 5:00 p.m.
    T, Th: 1 p.m. - 3 p.m.

    I’m scratching my head trying to figure out a way to template this and I’ve browsed devot-ee looking for something that might aid me but I’m coming up short. Events modules and extensions seem to be too limiting as they have definitive start and end times and time field types don’t cover the day of the week.

    I have solspace calendar but haven’t had the chance to explore it yet. Might that cover what I’m looking to do? I wouldn’t want to display the output in a calendar format but rather just as text.

  • #2 / Sep 09, 2011 11:53pm

    aircrash

    293 posts

    I don’t think the calendar module would do what you want.

    Could you just use a text field, and type in the hours in whatever format works best, or are you looking for a more specific solution?

  • #3 / Sep 10, 2011 3:23am

    imjared

    23 posts

    Could definitely use a text field. Was hoping there was something that would lock people in for the sake of formatting but I’m thinking the easier way might be the best in this case.

  • #4 / Sep 10, 2011 12:13pm

    Rob Allen

    3114 posts

    I generally use simple text fields to describe opening hours. As you have several offices I’d make a “Locations” Channel and put all relevant data in there including things like addresses, maps and so on. Once that’s in place you can easily relate office data if you needed to add things like staff lists per office in future.

  • #5 / Sep 10, 2011 12:33pm

    John St-Amand

    865 posts

    A Matrix field is a great option for this sort of thing, broken into three (sometimes just two) columns - one for Label (i.e. Monday or Monday to Wednesday, etc) and one or two for times - either one for a time range or just break it into two for open time and close time.  That way the client can choose how to break down the display of their hours.  Some like to display each day separately even if the times are the same. Some like to group days together than have the same hours.  This way, they get to choose and you don’t have to pre-define that setup for them.

    And of course the real plus is once you have the Matrix add on to serve this purposes, there are countless other ways you can implement it to create flexibility within a given field elsewhere in your site.

    Hope that helps.

  • #6 / Sep 10, 2011 3:45pm

    imjared

    23 posts

    Thanks all, sounds like Matrix + text input is the way to go.

  • #7 / Sep 10, 2011 5:42pm

    John St-Amand

    865 posts

    Definitely a flexible way to handle that need and more. Glad it helped.

    Incidentally, if you want to make it truly foolproof for the client an ensure that for every location they enter it in the same way, you could have the times as dropdowns, and therein control te time format used more effectively as well. Even the day labels could be handled as dropdowns if you knew they always wanted it entered on a day by day basis (though if they wanted the flexibility of groupings, like Mon, Wed, & Fri with same hours and therefore only one matrix row for all three combined, that’s not practical). A quick discussion with your client and you can give them as much or as little flexibility as they would prefer the admin to have.

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases