I'm using filefield with jquery media to display my videos, but I don't need to show file name under them: can I hide it?

Comments

dopry’s picture

Status: Active » Closed (fixed)

sure in jquery it's something like $(selector).hide().

Joanzo’s picture

Status: Closed (fixed) » Active

hei, i found this to hide filename and icon

$('.filefield-item .filefield-icon').hide(); //hide icon
$('.filefield-item div div').hide(); //hide link text 

but i don't know where to put it...
where should i put it ?
i try to put in .module or .inc
but it return error.. can someone help me?

Anonymous’s picture

I was looking for this answer too... and discovered a simpler solution.

Use Content Template (or another method) to remove the display of the linked file name. Just have the href code like this:

<a href="<?php print $node->field_video_url[0]['view'] ?>"></a>

Note that there's nothing between the closing > and </a>. Jquery Media still interprets the link as an embedded video.

Nothing like an elegant solution!

bbamboo’s picture

I had the same problem. Then finally I found this post:
http://drupal.org/node/343106
I tried what the original poster did and it worked for me.

drewish’s picture

Status: Active » Closed (won't fix)

great sounds like there's plenty of ways to do it.

stackpool’s picture

http://drupal.org/node/300853

Or, you could just do it the lazy way! :-)
.field-field-videofile {color: #FFFFFF;}

jrockford’s picture

Well I know this is not the best solution to remove the file name in D6x but it works so far for now. It is line 124 in "FileFormatter.inc" in the module "filefield"

Anyway, my solution : Note the empty $file[""] originally is $file["filename"] just leave it empty and it doesn't send the file name to the screen. Haven't thoroughly tested this but it should be ok.

// Use the description as the link text if available.
if (empty($file['data']['description'])) {
$link_text = $file['']; /////filename (removed to clear file name )
}
else {