Good morning
We have an auto index page, in which we want to provide a specific header for a slot item that matches the current date. In the auto index velocity template, i set up the following bindings:
$current_issue_day = $tools.date.getDay()
$current_issue_month = $tools.date.getMonth() + 1
$current_issue_year = $tools.date.getYear()
within the slot loop (#foreach($relresult in $sys.currentslot.relresults ))
i set the following variables:
#set($month_display = $relresult.getNode().getProperty(“rx:src_creation_date”).string.substring(5,7))
#set($day_display = $relresult.getNode().getProperty(“rx:src_creation_date”).string.substring(8,10))
#set($year_display = $relresult.getNode().getProperty(“rx:src_creation_date”).string.substring(0,4))
where src_creation_date is in the format yyyy-MM-dd
I then have the following check:
#if($year_display == $current_issue_year)
display a
#elseif…
display b
#end
the first check on the if statement is never passing, eventhough when i output the variables, they are the same value. one thing i noticed is that the value set in the binding is java.lang.integer, and the variable set in the loop is a string…would this cause the check to fail? if so, is there a way to check a string and integer?