Going Directly To The Attachment When Viewing A CCK Content Type That Just Has Attachments

So I've been working on our Intranet redesign with Drupal and one issue we have is we want people to be able to post PDFs to the Intranet. The simplest way to handle this in Drupal is to create a content type for PDF and use the CCK file field to give people the ability to upload files. This way the PDFs sit by themselves and won't have to be attached to a particular page (which is what happens if you use the default Drupal upload module). Also the upload module makes it so that any node can have files attached which I didn't want.

The issue with doing it this way is that when you click on a PDF node you end up at a page that has the Title and a link to the PDF you uploaded. This isn't what we wanted. Instead we wanted the link to take us to the PDF proper. To do this one has to make a template for that content type. Normally when you want to alter the template for a content type you create a new node template. But this only allows you to alter the content portion of the screen (ie. the portion where the node displays usually the center of the screen). If you want to change something more than this you need to alter both the page and node template along with adding some new info to your template.php file.

Very clever, I love this!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

We're trying to do this exact

We're trying to do this exact same thing with our site, but are theming newbies. Could you give any more details, or attach some helpful thinks to this post? Thanks!

Theming? Sorry, I meant

Theming? Sorry, I meant templating.