51 Posts
ostap
8 years ago
3
Topic

Good evening. Maybe someone knows: Is it possible to organize the Lists, to apply formatting (CSS) on the output values depending on (sorry) from their values.
That is, for example output "yes" - green, "no" - red.

Get a VIP membership
1283 Posts
Bucklash
8 years ago
0
Level 1

Hi

One way would be to do a position override in which you have an if statement

if ($cck->getValue('some_field') == 'some-value') {
$someClass = 'green';
} else {
$someClass = 'blue';
}

And some divs...

<div class="$someClass">
    <h2>$cck->getValue('art_title')</h2>
    <p>$cck->renderField('some_rendered_field')</p>
    <div>$cck->getHtml('some_fileds_html')</div>
</div>

Even if you are not going to display $cck->getValue('some_field'), make sure it is in your template's position somewhere ie mainbody or hidden etc 

   

Bucklash

51 Posts
ostap
8 years ago
1
Level 1

Thank you. I came up with another way:

1283 Posts
Bucklash
8 years ago
0
Level 2

Hi

Cool!

post a tutorial? ;)

Get a VIP membership