How do I repeat group in email template

Hi, I just noted that the date in the email defaults to 1-1-1970. And any input on hidden groups?

Thanks,
KooTjoo
 
For the Repeat Group example above, is there a way to put the repeat group in reverse order?

Instead of [0], [1], [2]...I would like [2], [1], [0]
 
Ok - played around with it - and I got it working with this code (not sure if this is the cleanest way?)

Code:
<?php
 
$repeats = $this->data['fabrik_repeat_group'][11];
for ($repeat=100; $repeat >=0; $repeat=$repeat-1) {
if ($this->emailData['sdm_incident_notification_11_repeat___update_raw'][$repeat] != "") {
//for($i=5; $i>=0; $i=$i-1)
 
?>
    <tr>
    <td class="left" style="border-bottom: 1px #69C;width: 195px;text-align: left;font-family: Verdana, sans-serif, Arial;font-weight: normal;font-size: 0.7em;color: #404040;background-color: #fafafa;padding-top: 4px;padding-bottom: 4px;padding-left: 8px;padding-right: 0"><b><?php
    echo $this->emailData['sdm_incident_notification_11_repeat___timestamp'][$repeat] . ":"; ?></b><br /><br /></td>
 
  <td class="contact" style="border-bottom: 1px #69C;width: 550px;text-align: left;font-family: Verdana, sans-serif, Arial;font-weight: normal;font-size: 0.7em;color: #404040;background-color: #fafafa;padding-top: 4px;padding-bottom: 4px;padding-left: 8px;padding-right: 0"><?php echo $this->emailData['sdm_incident_notification_11_repeat___update_raw'][$repeat]; ?><br /><br /></td>
</tr>
  <?php
}}
?>
 
Try ...

PHP:
$repeats = $this->data['fabrik_repeat_group'][123] - 1;
for ($repeat = $repeats; $repeat >=0; $repeat--) {

Your way might work, but it'll pitch warnings if you ever bump error logging up, as you are trying to access array indexes which don't exist.

The trick is just to decrement that $repeat by one when you assign it, as the repeat array is indexed from 0, not 1. So if there are (say) 5 repeats, the array will be indexed from 0 to 4, not 1 to 5. So start with 4, and loop round decrementing till it's 0.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top