85 Posts
yuberlin
9 years ago
1
Topic

Is it possible to add "if else" statements in list type typo when loading fields? 

In my list type i set all fields to "Clear" in "list -> 2 -> Typography". Then i load all of them in one field via "list -> 2 -> Typography -> HTML" like:

<img src="/$cck->getThumb2(my_image_field1')" alt="$cck->getValue('my_text_field1')" />
<img src="/$cck->getThumb2(my_image_field2')" alt="$cck->getValue('my_text_field2')" />
<img src="/$cck->getThumb2(my_image_field3')" alt="$cck->getValue('my_text_field3')" />
...

The problem is when one of them is not filled, i get empty img in my output. So is there a way to use if else statements in typography or another way to load the fields only when filled. For custom content templates this is not a problem but i didnt find a way for list views yet.

Get a Book for SEBLOD
572 Posts
_jrmo
9 years ago
0
Level 1

Hi yuberlin,

No, unfortunately not. But, you can do this with Position Overrides instead.

Cheers,

James

Get a VIP membership