cck module

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!

Donate To Get CCK Into Drupal Core

It's been years since we are dreaming of getting CCK into core. Dries has announced a code sprint, where six people are going to work on this for an entire week. That's 240 (wo)manhours and all we ask is a $7000 donation. This is your only chance to hire the top Drupal coders for less than a $30 hourly fee. If you have ever used CCK please consider donating the equivalence of one hour payment of your time -- it surely saved that many but likely even more.

Image Field And Image To Merge By Drupal 7

I'm at the Drupal and Multimedia session at DrupalCamp NYC 5 and they were briefly going over the modules that there are (a) there are a lot and (b) there's usually several ways to do something. One thing they pointed out was that by Drupal 7, the plan is for image module and imagefield module to merge. Great, this will cut down on redundancy and it will give site-builders a clear solution that will hopefully do everything they need it to do.

I also think that MAQUM should be migrated to imagefield and a lot of the metadata should be shoved into a CCK field.

Views 2 And CCK 2 Hit RC Status For Drupal 6

We are excited to announce that three key modules, Views, CCK, and Organic Groups, have published release candidates today, ready for testing. If you are interested in speeding the transition to a full release, install and test the Release Candidates (RC).

Hooray!

Image (And File Handling) In Drupal 6 And Beyond

In the beginning (2002), there was Image, and everyone could create images as nodes and all was good, if a bit simplistic. (There was even IPTC and EXIF metadata support). After a little bit of time, you could even attach images to nodes. By 2006, images could be attached to nodes. (By now, Flexinode had been around for a while and CCK had been around for a bit, too.) CCK became the predominant way of creating content types, as opposed to writing a new module for each individual content type. ImageField, a CCK add-on, (released in July 2006) allowed images to be handled by CCK. This, combined with other CCK fields let you do all sorts of neat things like set up an online store with one field being the name of the object your are selling, another field being the description and another three or four fields for uploading images of the product. Or you could be an online newspaper and have anywhere from zero to several images per article. Each page (whether online store or newspaper) could be themed to layout the information appropriately with ImageCache creating derivative (read: resized and/or cropped) images.

Fast forward to 2008 and there's primarily two ways to get images in your Drupal site, with Lullabot's Image vs. ImageField and ImageCache being the definitive comparison between the two. If you were fine with images as nodes and had simple needs (gallery, photoblog, etc.) you probably went with (or continued using from back in 2002) Image. On the other hand, if you were creating tons of content types thanks to CCK, you probably jumped ship to ImageField.

Now, there's talk about merging Image with ImageField (and ImageCache), with a script to migrate from Image to ImageField. But it was also pointed out that one field to handle all uploaded files, images or not, should be the way to go and that this would be the end of ImageField. FileField, combined with FileField Image would handle everyone's imge handling needs (as well as other file types as well).

While some people think images need special handling (and they are right to a degree and FileField Image takes care of this) there is also the consideration that other file types need special handling, such as videos. Just like images have a need for derivative images, so do videos (original high resolution, low resolution, stored as a flash file and a thumbnail screencap to display in the page). Having one unified way of uploading files would mean less code to maintain and there might even be a reasonable chance of getting file (and potentially image) handling in core, the CCK way.

(For these reasons, I've decided to postpone a D6 release of MAQUM.)

Curly Quotes To Straight Quotes Meets Blog This Bookmarklet For Drupal

Using Drupal's prepopulate module, bookmarklets, like the one bundled with WordPress, to blog this are easy to craft. (Though at the time, it wasn't properly documented how to form prepopulated URIs when using grouped CCK fields.)

Anyhow, leaning heavily on Mark Pilgrim's Dumb Quotes code (found via a del.icio.us Dumbify Quote Bookmarklet), I came up with the following:

javascript:
u=location.href;
t=document.title;
s=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);
s=s.replace(/\"/g,"'");
s=s.replace(/\xa0/g,"");
s=s.replace(/\xa9/g,"\(c\)");
s=s.replace(/\xae/g,"\(r\)");
s=s.replace(/\xb7/g,"*");
s=s.replace(/\u2018/g,"'");
s=s.replace(/\u2019/g,"'");
s=s.replace(/\u201c/g,'"');
s=s.replace(/\u201d/g,'"');
s=s.replace(/\u8220/g,"'");
s=s.replace(/\u8221/g,"'");
s=s.replace(/\u2026/g,"...");
s=s.replace(/\u2002/g,"");
s=s.replace(/\u2003/g,"");
s=s.replace(/\u2009/g,"");
s=s.replace(/\u2012/g,"--");
s=s.replace(/\u2013/g,"--");
s=s.replace(/\u2014/g,"--");
s=s.replace(/\u2015/g,"--");
s=s.replace(/\u2122/g,"\(tm\)");
void(window.open(%22http://brianpuccio.net/node/add/excerpt?edit[group_external_content][field_external_title][0][value]=%22+encodeURIComponent(t)+'&edit[group_external_content][field_external_content][0][value]='+encodeURIComponent(s)+'&edit[group_external_content][field_external_link][0][value]='+encodeURIComponent(u),'_blank','width=1024,height=500,status=yes,location=yes,resizable=yes,scrollbars=yes'));

Modify as needed for your personal site.

Syndicate content