EllisLab text mark
Advanced Search
     
Code not working on latest build of EE
Posted: 25 June 2012 11:01 AM   [ Ignore ]
Joined: 2010-08-17
85 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?

 
Posted: 25 June 2012 12:13 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2010-10-19
146 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?

 Signature 

I’m with shoeshinedesign.com - @shoeshinedesign

 
Posted: 26 June 2012 11:34 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
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,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade