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.

What is blooming this week?

May 13, 2010 7:58pm

Subscribe [2]
  • #1 / May 13, 2010 7:58pm

    sandiegozoo

    62 posts

    I am currently working on a horticulture site, and each of the species listed will have the weeks of the year in which they usually bloom designated - either via category (week 1, week 2…) or by a similar custom field.

    Once all have been entered, we are going to be looking to create a page where all the flowers currently blooming will be dynamically listed.  I know I could do this using mysql (select week(curdate(),3)), but is that the best way to go about it?

    Any advice would be greatly appreciated.

    Kristin

  • #2 / May 13, 2010 11:54pm

    Dave @ Exp:resso

    465 posts

    Theres a few ways to go about this. For a start, you can use {current_time format="%W"} - that returns the current week number which you can use to match up to your category or custom field. Would be easy if you could put the category url title in the exp:chanel:entries ‘category’ parameter (this may be possible), but failing that, could be best to set up a custom field (probably a multi-select) to store the week numbers. Lets say that field is called ‘bloomdate’. You’d then add search:bloomdate=”{current_time format="%W"}” into your channel entries tag. Haven’t testeed this but should work in theory. Hope that helps

  • #3 / May 14, 2010 2:33am

    sandiegozoo

    62 posts

    Dave,
    You are a sweetheart.  I am not, yet, however, on 2.0.x, as our sites are live and high-traffic.  The powers that be do not want them running on anything that even has the aftertaste of “beta”. :/  This kills the chanel module, and I am loathe to use a multi-select or checkbox, as I have not found any reliable documentation on whether any of the plugins (like FieldFrame) will work once I do get the green light to upgrade…
    Are there any other possibilities?

    Thanks in advance,
    Kristin

  • #4 / May 14, 2010 2:48am

    Dave @ Exp:resso

    465 posts

    I haven’t actually used 1.6 sorry, so can’t really help there! I got started in EE just at the right time so dont have any complicated upgrade processes to worry about 😊

    Each entry will have more than one bloom week though right? I bet you could do this with Brandon’s Playa module.
    Or You could set up categories, set the week number as the url_title, and then use the query module to find all entries where the category url_title = {current_time format=”%W”}. Not sure on the exact query, but its definitely do-able. Would be a lot easier if you could simply insert the url_title as a parameter in the exp:weblog:entries tag, then you wouldn’t need a query.  Not sure how multi-selects work in 1.6, but it makes more sense do it that way.

    Didn’t even realise flowers had specific bloom dates- I thought it was just X months after you plant them!

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

ExpressionEngine News!

#eecms, #events, #releases