On my Drupal powered website, I want to list available downloads at the top of a node page (within a narrow float:right <div>
), not at the bottom where they normally appear.
Within my theme, I've overridden the theme_upload_attachments()
function to generate a <div>
of width 40%, but this is showing up at the bottom of the page.
Within the upload.module
file is code that controls where the attachments are listed on the page:
// function upload_nodeapi(), line #284 of upload.module
$node->content['files'] = array(
'#value' => theme('upload_attachments', $node->files),
'#weight' => 50,
);
If I manually hack this #weight to -1, my custom list of attachments shows where I want, floating at the righthand side of the top of the content area.
However, I don't want to manually hack the core file upload.module
, as my changes will be lost next time I apply an upgrade (say, for a security patch).
How/Where do I modify the #weight of content['files']
within my theme code?
Or, am I going about this the wrong way?