Forums

CCv5> conditional styling

admin_wiky 03 Sep, 2014
Hi all,

How put condition to the styles field? I need color cell by 2 values. Like ..

model.column:if ($saldo>$row['model']['row']) font-weight:bold;text-align:right;color:red; ELSE font-weight:bold;text-align:right;


but it doesnt work
thx
Max_admin 08 Sep, 2014
This box doesn't accept PHP, but you can pass an array, e.g:
Model.field:text-align:right;

Model.field:array(0 => "text-align:right;", "*" => "text-align:left")


You can add as many array keys as you want, in the example above, if the field value = 0 then align right, in all other cases, align left, you could also add other values!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
admin_wiky 09 Sep, 2014
Hi max,

I understand, but how write it if I need decide by like value1>value2?

thx
Max_admin 12 Sep, 2014
There is no way to do any data processing except by using the PHP functions box, so you will need to do the processing there and output a full code with styling!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
admin_wiky 12 Sep, 2014
Yes, I understand but I cannot modify styling in php functions or I can?
I need color a value by comparison of two values.
Max_admin 12 Sep, 2014
Answer
1 Likes
You can, but the php function should return the full cell/field output, e.g:

return '<span style="...">'.$row["Model"]["field"].'</span>';


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rahmi 21 May, 2015
hello
It will be two questions
1 listing in the imaging field or other fields, depending on the display to (CCV5)
2 providing unique data field (CFV5)

Waiting for your help
Max_admin 22 May, 2015
Sorry but I can't understand what you are trying to do here, is this related to this topic ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rahmi 22 May, 2015
Hi max,
I'm sory I dont know english well
I trying to make conditional listing
for example
I have 4 fields
CCv5 listing
field1
field2
field3
field4
if field3=No field2 hide field1, field3, field4 show else all fields show
Max_admin 23 May, 2015
You will need to write this logic using PHP code in the "PHP functions" box, the function should be in 1 line only in order to be parsed.
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rahmi 25 May, 2015
Hi

How should I write a code. Can you give an example

When used in this way does not seem all lines

" return array ("model.field" => "XYZ"); "

Thank you for your support
Max_admin 26 May, 2015

Model.field1:if($row["Model"]["field1"] == "x"){return "style code";}else{return "";}

You can use any fields, this is just an example!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rahmi 26 May, 2015
Hi Max,
I'm very grateful for the source, it works flawlessly.
But I have a simple question to ask for. How can I add an image field to the form? and give an example if possible.
Thanks.
rahmi 03 Jun, 2015
Hi Max,
Thank you for your contribution
I want to be unique to one field (no duplicate)
but I did not know how to make
also if you could help in this regard
This topic is locked and no more replies can be posted.