This seems like it should be a simple thing to do, but I haven't found a good way yet.

Filefield is working great for me except I'd like to rewrite the output so that instead of displaying the actual filename I'd like to have generic text, like "download the pdf here". I suppose to do this within CCK there would need to be a different display preset other than "generic files". Is there some way to do this that I'm missing? Any help on this would be appreciated.

Comments

quicksketch’s picture

You can do this by overriding theme_filefield_item() in your theme.

giorgio79’s picture

Just been looking for this.
quicksketch would you consider an additional and optional link to download the file stored by Filefield?

Sg like http://drupal.org/project/filenode with url masking.

Or no new features in D6?

quicksketch’s picture

quicksketch would you consider an additional and optional link to download the file stored by Filefield?

Probably not. This problem is already solvable by theming the theme_filefield_item() function and (as you mentioned), no new features are being added to ImageField.

giorgio79’s picture

Status: Active » Closed (fixed)

Ok, thanks quicksketch

giorgio79’s picture

Status: Closed (fixed) » Closed (won't fix)
eriklharper’s picture

I've taken a look at the code for the function you mentioned and can't see how I would go about overriding this to change all file links to the word "download" rather than display the file name. Can you show us some sample code to do this?

dale386’s picture

I am looking for a way to change the display of a file in a view, which is not possible by overriding theme_filefield_item(). Any suggestions?

grasmash’s picture