it's possible display active member icon in listing module?
I just need to say if active or not active by word or icon on the list, any idea?
Attachment 120
Thanks for advance!
Printable View
it's possible display active member icon in listing module?
I just need to say if active or not active by word or icon on the list, any idea?
Attachment 120
Thanks for advance!
Hi, the name of the field you need is "disable" (https://github.com/contao/core/blob/...ember.php#L355)
Add it in the listing module definition.
This should at least display a '1' in the frontend for each disabled member.
Now you have to modify the template of the listing module to display a text or icon.
Hi cliffen,
Interesting, but that value is only for disable users by the eye icon "manually", you know were is the value of disable users by date? "Automatically". It not the same value.
Thanks for advance... :)
Look at this function, it displays the icon: https://github.com/contao/core/blob/...ember.php#L496
It checks the attributes 'disable', 'start' and 'stop'.
Yes, that is the function, you could give me an idea of how to integrate that function in list_default.html5?
Thanks for advance.PHP Code:
<?php foreach ($this->tbody as $class=>$row): ?>
<tr class="<?= $class ?>">
<?php foreach ($row as $col): ?>
<td class="body <?= $col['class'] ?>"><?= $col['content'] ?></td>
<?php endforeach; ?>
<?php if ($this->details): ?>
<?php if ($col['details']): ?>
<td class="body <?= $this->col_last ?> col_last">[B]image status here[/B] <a href="<?= $col['url'] ?>"><img src="<?= TL_FILES_URL ?>assets/contao/images/info.gif" alt=""></a></td>
<?php else: ?>
<td class="body <?= $this->col_last ?> col_last"> </td>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach; ?>
Do you have $col['start'] and $col['stop'] in your template? You have to check them against actual time - time().
Hi Andreas,
I only include firstname, lastname, phone, gender, city, stop
Attachment 121
I will add this value, no problem. Once i add those values, how I call the function in the right way?
Thank you for your interest in this situation.PHP Code:
<? php $member = new tl_member ();
$member-> addIcon ($param 1, $param 2, $param 3);
? >
I will not work on your complete code as it is to time-consuming.
First I think it will be better to switch from the template coding style (alternating php and html) to simple php coding style.
Then you can do something like
And now its easier to bring in your IF clauses.PHP Code:
<?php
$table = '<table>';
// Head
$table .= '<thead><tr>';
foreach($this->thead as $col)
{
$table .= '<th>'.$foo.'</th>';
}
$table .= '</tr></thead>';
// Body
$table .= '<tbody>';
foreach($this->tbody as $class => $row)
{
$table .= '<tr>';
foreach($row as $col)
{
$table .= '<td>'.$foo.'</td>';
}
$table .= '</tr>';
}
$table .= '</tbody>';
$table .= '</table>';
echo $table;
?>
If you want to show disabled and temporary disabled status you have to add disabled and start to the list module. You then don't need to work with the Member Model to get the values of each data set.