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.

Code not working on latest build of EE

June 25, 2012 11:01am

Subscribe [4]
  • #1 / Jun 25, 2012 11:01am

    OwensDDB

    42 posts

    We’re upgrading a site and a chunk of code - intended to show opening hours of a shopping centre - does not work in the latest build. It however worked fine in 2.1.0. The code is basically saying “if this is not a bank holiday, show today’s opening times”

    {exp:channel:entries channel="occasion" status="open" sort="desc" limit="1" orderby="date" dynamic="no"}   
        {if "{current_time format='%Y%m%d'}" == "{occasion_date format='%Y%m%d'}"}
           Open Today {occasion_opening}
        {if:elseif "{current_time format='%w'}" == "1" AND "{current_time format='%Y%m%d'}" != "{occasion_date format='%Y%m%d'}"} 
            Open Today 9am - 6pm
        {if:elseif "{current_time format='%w'}" == "2" AND "{current_time format='%Y%m%d'}" != "{occasion_date format='%Y%m%d'}"} 
            Open Today 9am - 6pm
        {if:elseif "{current_time format='%w'}" == "3" AND "{current_time format='%Y%m%d'}" != "{occasion_date format='%Y%m%d'}"} 
            Open Today 9am - 9pm
        {if:elseif "{current_time format='%w'}" == "4" AND "{current_time format='%Y%m%d'}" != "{occasion_date format='%Y%m%d'}"} 
            Open Today 9am - 9pm
        {if:elseif "{current_time format='%w'}" == "5" AND "{current_time format='%Y%m%d'}" != "{occasion_date format='%Y%m%d'}"} 
            Open Today 9am - 9pm
        {if:elseif "{current_time format='%w'}" == "6" AND "{current_time format='%Y%m%d'}" != "{occasion_date format='%Y%m%d'}"} 
            Open Today 9am - 6pm
        {if:elseif "{current_time format='%w'}" == "7" AND "{current_time format='%Y%m%d'}" != "{occasion_date format='%Y%m%d'}"} 
            Open Today 12pm - 6pm
        {/if}
    {/exp:channel:entries}

    Has there been a change in syntax with this new version?

  • #2 / Jun 25, 2012 12:13pm

    Stephen Callender

    148 posts

    At what point is it breaking? With the conditionals or the channel:entries tag?
    If you reduce to just the channel:entries tag without the conditionals does it print anything?

  • #3 / Jun 26, 2012 11:34am

    Shane Eckert

    7174 posts

    Hey JamieFirstAd,

    I am sorry to hear you are running into this problem.

    Stephen has asked the questions I would have asked. Can you address those?

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases