Hi. I've used HTML rather that Link to show the word "Download" instead of the field contents for uploaded files. Sometimes the filenames are really long so the table displayed looks bad. I also used HTML so that I could make the target of the link _blank.
Problem is, if there was no file upload for a record, the html still shows but with the link missing a filename. So I get presented with a blank index.html page.
Was this the best way to do this? If so, can I conditionally only display the DOwnload link if a filename is in the data record?
thanks, sem
Problem is, if there was no file upload for a record, the html still shows but with the link missing a filename. So I get presented with a blank index.html page.
Was this the best way to do this? If so, can I conditionally only display the DOwnload link if a filename is in the data record?
thanks, sem
You can try this in the HTML box:
What this means is that, an empty string will be used when the field value is empty, and the link will be used for anything else.
You could also use the "PHP functions" in order to check if the field is empty and return the value you want to display:
Regards,
Max
array("" => "", "*" => "Link code goes here")
What this means is that, an empty string will be used when the field value is empty, and the link will be used for anything else.
You could also use the "PHP functions" in order to check if the field is empty and return the value you want to display:
Model.field:return (empty($row["Model"]["field"]) ? "" : "Link code goes here, and pay attention for the double quotes.");
Regards,
Max
This topic is locked and no more replies can be posted.