I was curious if there is a way to display the actual list of file links attached to a page node as opposed to displaying the text:

"[#] attachments" - [#] being however many attachments there were.

I attached an image for further clarification.

CommentFileSizeAuthor
nodes-in-block-files.jpg43.01 KBdanish_nizzle

Comments

swentel’s picture

Status: Active » Closed (fixed)

If you render the node as a page, it should do that.

When looking at the code in upload module, you'll find this:

    case 'view':
      if (isset($node->files) && user_access('view uploaded files')) {
        // Add the attachments list to node body with a heavy
        // weight to ensure they're below other elements
        if (count($node->files)) {
          if (!$teaser && user_access('view uploaded files')) {
            $node->content['files'] = array(
              '#value' => theme('upload_attachments', $node->files),
              '#weight' => 50,
            );
          }
        }
      }

It only renders the files when the node is rendered with the $page boolean. So you can
a) Render it as full node
b) write your hook_nodeapi and add this same function to the node object.