Closed (fixed)
Project:
FileField
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Reporter:
Created:
5 Sep 2007 at 11:19 UTC
Updated:
9 Oct 2007 at 16:31 UTC
I post file in my template like print content_format('field_file2',$field_file2[0]);
but when filename is very big it looks not good.
How to change file name to "my link" for example or post first 3 words....?
Comments
Comment #1
jpetso commentedYou've got two options here:
a) Set the "Description" field in the node form to something other than the file name.
b) If that's no option, set $field_file2[0]['description'] to your desired value before calling content_format().
One of those two should do the job.
Comment #2
jpetso commentedMarking as fixed.
Btw, if you want to disassemble (cut off) the file name, you can find it in $field_file2[0]['filename'].
Comment #3
jpetso commentedAnd just to clarify, this would look something like (attention, untested)
(Mind that the file name is the default value for the description.)
Comment #4
(not verified) commented