add a Flag language in list view using a calc element

javier94

Member
hello,

I would like to add a flag language in a list view.. using a calc element.. i'm not sure if is the best option.. (maybe other is better)


the element cartas_registro___idioma_documento__1 .. (field element where name of language is) .. in this case "Castellano"
so depending of the language will put one flag or other

the code starts like this.

$idioma = '{cartas_registro___idioma_documento_1}';

if ($idioma=='Castellano'){
echo "<img src='/images/b-esp-20x12.png'>";
}

if ($idioma=='Català'){
echo "<img src='/images/b-cat-20x12.png'>";
}

if ($idioma=='English'){
echo "<img src='/images/b-uk-20x12.png'>";
}

if ($idioma=='Galego'){
echo "<img src='/images/b-gl-20x12.png'>";
}

if ($idioma=='Euskera'){
echo "<img src='/images/b-eus-20x12.png'>";
}

else{

}

return;

marc-1-bandera.PNG I have not received any error code, the calc element returns the appropiate image flag, but not in the right position list.. as you can see in the image..

Appears in the List tittle.. instead of. in list raw..

Any suggestion??

thanks

Javier
 
Last edited:
Make it "return" instead of "echo".
Code:
$idioma = '{cartas_registro___idioma_documento_1}';

if ($idioma=='Castellano'){
return '<img src="/images/b-esp-20x12.png" />';
}
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top