Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted August 11, 20159 yr Is it possible to find and use the position of a record in an array to then use the data stored?At the minute I could do:{{foreach $records as $record}} However that is of course all records. What I want to do is use the first record in the array in some way, then use the other records in another way.
August 11, 20159 yr In most places, zero-indexed arrays are used, so you can do something like:{{foreach $records as $idx => $record}} {{if $idx == 0}} First... {{endif}} ...In places where the key is something else, you can track it manually. Something like:{{$doneFirst = false;}} {{foreach $records as $record}} {{if !$doneFirst}} First... {{$doneFirst = true;}} {{endif}} ...
Archived
This topic is now archived and is closed to further replies.