Drop-in override for Upload.module's attachments list

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
bensheldon's picture

Below is a custom override for Drupal 6.x's Upload.module's attachments table that is displayed at the bottom of a node when you create file attachments. Below is an example of the before and after:

Only local images are allowed.

I think my implementation conforms to what the Themer pack is going for: unzip and drop the included folder into your active theme's directory (e.g. /sites/default/all/garland), it should take effect without any other modifications---though you may have to reset the theme cache (goto admin/build/themes and click save without making any other changes).

Click Here to Download (shiny_upload.zip)

The icon code is based on the CCK filefield module---but the current 6.0 version is kind've clunky and I wanted to port it to the standard Upload module. The namespace is "shiny_upload".

I'd love any feedback you have or how I can make it more extensible. Also, please feel free to take it and maintain it and make it yours.

Comments

Nice.

webthingee's picture

I think this looks very nice. Seeing as how I am using filefield module on a new project, I think I might just drop this in.. thanks.

nattyweb's picture

A great modification, thank you. I made a slight alteration to the code, to allow me to separately style the filename and file size - this wasn't possible as the file-name span tag (on line 23 of upload_attachments.tpl.php) didn't close properly.

Here's the original line:

  $file_metadata = '<div class="file-metadata"><span class="file-name">' . $file->filename . ' <span class="file-size" >' . format_size($file->filesize) .  '</span></div>';

Here's my replacement line:

  $file_metadata = '<div class="file-metadata"><span class="file-name">' . $file->filename . ' </span><span class="file-size" >(' . format_size($file->filesize) . '</span></div>';

Then in the CSS I was able to alter the appearance of both file name and file size, including removing filename altogether by adding display: none.

Separate comment: How would you alter this so the document opened in a new browser window?

Thanks again

D.5 version?

jonahan's picture

This is awesome.

Any tips on how to get going on a D5 version?

Question

cmurockstar's picture

This is amazing! Quick Question, how ever did you get the titles associated with your attachments?

Fixed the CRON problem

demeester_roel's picture

See http://island94.org/articles/overriding#comment-3783 for the cron-breaking problem when using this 'package'.

I can't seem to upload the module so please grab it on http://krimson.be/en/shiny-upload-almost-converted-a-module.

Install the 'shiny_upload' module and move an included tpl to your theme to get it running.

Good luck

Belgian Drupal User Group lover - http://drupal.be

Belgian Drupal User Group lover - http://drupal.be

Where a link to the shiny

hixster's picture

Where a link to the shiny upload that fixes the cron issue? The above link is broken?

try looking at the iTweak module

mrchrisadams's picture

Hi Hixter,

I was looking for just the same thing as you yesterday, and I ended up going with iTweak Upload in the end - it did pretty much everything I needed. Aside from changing an imagecache settings, and tweaking the CSS, it was pretty much a drop in affair, so I think it might be useful to you.

what is the correct path for storing this folder?

evabryn's picture

I'm loving the look of this amendment, but cannot get your download path/storage to square... I' using Drupal 6 but I haven't got a directory path as specified above.

I have tried dropping it in: /sites/all/themes/xxx and in /sites/default - none of these seem to work. Can you confirm what is the correct path?
Great work and many thanks
E

Themer Pack Working Group

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week