When you attach a file to a node, using Drupal's upload module, it is possible to give a description or title to the file. This is displayed instead of the filename in the file attachments listing at the bottom of the node.

It'd be nice if the inline module would default to using this description as the link title instead of the filename when no title is provided with the [inline:xx] tag.

Cheers,
Stella

Comments

stella’s picture

I managed to implement this by overriding the theme function like:

function theme_inline_as_link($file) {
  // Prepare link text with title or filename.
  $linktext = ($file->title ? $file->title : ($file->description ? $file->description : $file->filename));
  return l($linktext, file_create_url($file->filepath), array('attributes' => array('title' => t('Download: @name (@size)', array('@name' => $file->filename, '@size' => format_size($file->filesize))))));
}

It might be an idea to incorporate this change anyway. It's a nice feature to have. You may not even need $file->filename as the description defaults to the filename. However, there's no harm keeping it in case they set the description field to be blank.

Cheers,
Stella

bitsize’s picture

Thank You Stella.... Very Helpful!

sun’s picture

Status: Active » Fixed

This has been already fixed in 6.x-2.x - somehow.

Thanks for reporting, reviewing, and testing!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.