0

I have a series of performance dates; let's say 5.

 {performance_date_one format="%l, %F %j, %Y; %g:%i %a"}

However, after a date has passed, I want to gray the date out and remove the link, but I want to keep it on screen until all five performance are finished.

This code doesn't work. It prints two dates one grayed out the original date.

  {if performance_date_one}  
  {if "{expiration_date format='%U'}" < "{current_time format='%U'}"}
 <h5><i aria-hidden="true" class="fa fa-calendar"></i> &nbsp;  
 {performance_date_one format="%l, %F %j, %Y; %g:%i %a"}</h5>{/if}

 <h5 class="color-gray-aaa"><i aria-hidden="true" class="fa fa-calendar"> 
 </i> &nbsp;{performance_date_one format="%l, %F %j, %Y; %g:%i %a"} <span class="label    
 label-default small">PAST</span></h5>{/if}

I am stuck, any thoughts?

0

You simply need to change the inner IF statement into one that has an ELSE clause. So you get either the first or the second - your logic currently gives two lines if the inner-if statement fires. I think you want something like this...

{if performance_date_one}
{if "{expiration_date format='%U'}" < "{current_time format='%U'}"} <h5><i aria-hidden="true" class="fa fa-calendar"></i> &nbsp; {performance_date_one format="%l, %F %j, %Y; %g:%i %a"}</h5> {if:else} <h5 class="color-gray-aaa"><i aria-hidden="true" class="fa fa-calendar"></i> &nbsp;{performance_date_one format="%l, %F %j, %Y; %g:%i %a"} <span class="label la bel-default small">PAST</span></h5> {/if} {/if}

HTH

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.