Forum
Compare perch_item_last specific id outside of repeater
How do I get the id="date"
from perch_item_last
to compare with PerchSystem::set_var('today', date('Y-m-d'));
outside of the repeater?
<perch:repeater id="dates" label="Courses List" scope-parent="true" order="10" max="10" >
<perch:content id="date" type="date" label="Start Date" format="%a %e %b" />
</perch:repeater>
<perch:if id="date" match="eq" value="{today}" >
Result
</perch:if>
--
You can't target items inside the repeater from outside it. Are you able to perform your check inside the repeater?
I thought that might be the case. I'll think of a way inside the repeater.
Hello David,
What's preventing you from performing the check inside the repeater?
Your repeater doesn't have to output anything if you don't want it to. And if you need to output the repeater content some where and perform the check some where else, you can reuse the repeater.
Of course not thinking. That'll work.