Buy Now
Sign in

switch conditions - equal to - not equal etc.

gix.vax , May 21 at 14:49
Answered
G
gix.vax
hi
in a table view i have a field called document that have the path to a file or to a folder (the folder is ever \media\uploads\)
i want to use a switch so i can view
- when the value is a file it should show a button
- when the value is "\media\uploads\" it should show "no files to open"
i know how to use switches but the "empty solution" (var.empty:read_data......) is not usefull cause i need to evaluate a value or a NOT(value) condition
is there a way to control conditions of the swtch?
something like this
NOT(\media\uploads\):{view:apri_chat_file}​
​\media\uploads\:no file uploaded
thank you
G
gix.vax
hi all
i solved in this way
i use 2 switch to made the data empty or not
is a bit intricated but work
SOLUTION.
resume situation:
my data come from a field in DB that can contain "\media\uploads\" or "\media\uploads\myfile.ext"
i need to show a "open file" button only when the field is populated with a file not a folder (every time the value is else than "\media\uploads\" )
the view is a table view
1st switch in table view
switch name : switch_chat_doc
data provider the value of file field: {var:ticket_chat_list.row.ticket.documento}
There's only a condition : \media\uploads\:NON_VUOTO
(you can put wathever you want in NON_VUOTO)
you must use "return the result as a var"
now i have a a value that could be
- filled (NON_VUOTO string)
- empty
if empty i sayed i want to show a Open file button
(open a file named e.g. \media\uplaods\myfilename.ext)
to retrieve result and put button (or not) i use a second switch on result of first (BOTH IN TABLE VIEW!!)
2nd switch
name: switch_apri_doc
data provider : {var.empty:switch_chat_doc}
now only a condition here too : true:{view:apri_chat_file}
(apri_chat_file is my button)
in table view i put in column view
open_file_ticket:{fn:switch_chat_doc}​
​apri_doc_ticket:{fn:switch_apri_doc}
daje tutti!!
:-)
Gianluca
H
healyhatman
Could've just used a PHP function with echos in it as the column views
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman