List Row colouring

This is supplied as it was a question raised in the forum and others may wish to produce a similar effect on their sites.

The request was to be able to provide a row colour style in 1.2.2 to the Issue List display based upon the issue status code. The easiest way to achieve this is to edit the site/components/com_issuetracker/views/itissueslist/tmpl/default.php file.

We illustrate the providing colours to the open and the closed issue status. All other statuses can be similarly changed and it is left to the site to provide these since the status codes is use are site dependant.

In the file add the following lines in a suitable position. (i.e. In release 1.2.2 after line 31)

<style>
table.adminlist tr.status-4 td { background: red; color: white; }
table.adminlist tr.status-1 td { background: lime; color: black; }
</style>

It is now necessary to edit the line containing the 'tr' code within the 'tbody' section of the file. (i.e. In release 1.2.2 the new line 193)

Change

        <tr>        

To

        <tr class="<?php echo 'status-'.$dataItem->status;?>">

Edit the styles as you require. The number in the style relates to the specific id of the status code itself. i.e. 1 = Closed, 4 = Open. The colours may be a bit bright but you may specify them as an RGB code such as #20B2AA if you want something intermediate.

Note that this is possibly not the most efficient way to add a style, which should be in a stylesheet, but it will be the easiest if you are not all that familiar with CSS etc.

Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries