Adding Fields With CCK

This video shows how to add extra fields to existing content types (such as blog posts) using the Content Construction Kit (CCK) module in Drupal 6.

Bookmark and Share Bookmark or Share Post

Comments

Anonymous's picture

text next to videos

How can i put text on the left(or right) of the video, without using tables? I can use a simple table with one line and two rows, but in the table menu, you can't take out the outlines of the table and i want content to be added by non-programmers, so i'm asking a way to do this without the need for users to mess around with code.

Thank you and continue with the good work.

Anonymous's picture

Great Screen Cast

Great Screen Cast, but everything is left justified. If I add an extra field, how can I set it so that it appears in the middle or to the right of the page for example?

Thanks, keep up the good work.

learnbythedrop's picture

Theming CCK Fields

You can theme content types using a variety of methods. A popular method is to use the Contemplate module. I suggest that you check out http://drupal.org/project/contemplate.

Anonymous's picture

The embed code never appears.

The embed code never appears.

Anonymous's picture

I have embeded the code which

I have embeded the code which I know works as i'm tried it on simple html.
But on the page I just see the embeded text no movie.
Do I need a patch or anything? what am i missing?

learnbythedrop's picture

Embedding Video

I assume that you're trying to embed this video. Is that right? It all depends what type of editor you are using and what the input format is. For Drupal you should be using the full html format and you should not be using a rich text editor since rich text editors just wipe out the embed code. The embedded media field module is a good choice for making video embeds very easy within Drupal. http://drupal.org/project/emfield

Anonymous's picture

embedding video

Hmm still can't see it.
I can see a picture of puzzle in the embed code and have this code in the source.

I know the video is in the right place as I also use the download video URL the same.
I downloaded the emfield but don't see how that is required to play through windows media player. Sorry I feel I'm missing something really stupid but can't see it.

Anonymous's picture

I can“t see the videos

I have explorer and see the video interface but it wont start

learnbythedrop's picture

It's either a browser version

It's either a browser version or QuickTime version issue. Upgrading to the latest version of QuickTime should help.

Anonymous's picture

Can I use this in teasers?

Is there any way I could use embedded videos in teaser view? I want to scale down videos for teasers and display them in normal size for full node view. How to do this?

learnbythedrop's picture

Display CCK in Teaser

You can display an embedded video in the teaser. Using the "blog" content type as an example. If you add a field to that content type for storing an embed code, you can then go to /admin/content/node-type/blog/display/basic and select whether or not you want that field to display in the teaser or not.

Anonymous's picture

How are CCK fields stored?

Hi there :)

I'm just wondering if you know how CCK fields are stored? I'm editing the input fields of a module (Biblio) and am trying to figure out if Biblio is updated (for example) if the CCK fields will just disappear, or are they stored with the particular content type etc? Also, is there some way of searching by newly created CCK fields?

Thank you for making your videos :) They've helped me many times :)

cheers,
Josh

learnbythedrop's picture

Storing CCK Fields

CCK fields are always related to a content type. So step 1 is to select the content type you want to add to or create a new content type. Then you would engage in the process of adding different types of fields, like and image field, a url field or a date field to name a few. Those fields are essentially placeholders for content. While the specific field types may have restrictions as to the type of content place in them you will also choose whether or not they are required and whether or not the field can have multiple values to name two choices. The fields you add should only disappear if you specifically choose to either delete them or delete the whole content type. I'm not sure what you mean by searching CCK fields. I usually manage the fields one content type at a time.

Anonymous's picture

I just want to say a hearty -

I just want to say a hearty - THANK YOU! - Man, I wish I could sit down with you for one afternoon, and have you teach me some things. I appreciate your videos a LOT - but I could use you to slow-down a bit. I'm not as knowledgeable as most of your viewers, more a 'newbie', and you cover so much as though we should already know all of this - HOWEVER - THANK YOU!!! I appreciate what you do!
God Bless!
Lee

Anonymous's picture

I've created new fields, but

I've created new fields, but I just can see them, when I'm logged in.
What did I wrong?

learnbythedrop's picture

CCK Fields

When you say you can't see them do you mean you can't see them when you're creating a node? Or do you mean that you can't see them after a node is published?

Anonymous's picture

contemplate module

Hi... I want the user to have only specific fields while creating content. For example, while creating a book page my users see a lot of fields- title, menu, tags, body, input format, notifications, comments settings and blah blah... I've added the attach image/video/document field using cck. But I want to make it simple for them by having just a title, tag, body, book weight, attach image/video/document and language fields.I hear the contemplate module helps. But since I'm a newbie and a non-programmer, I can't understand how to use it. Would you include a video on working with the contemplate module? I

learnbythedrop's picture

Controlling Fields Users See

Contemplate is for altering what people see after a node is published. What you want to do is alter the user permissions so that only certain fields are seen when they are publishing. To do that you first need to create a role specifically for publishers on your site. The default role for people signed in is "authenticated user." The permissions you're interested in are the ones in the "node module" section. If you uncheck "administer nodes" then the users will not see all the node admin stuff. They will still be able to see CCK fields you add to the submission form if you grant those users permissions in the "content_permissions module" section.

Anonymous's picture

Controlling fields users see

Thanks.. its working... and now, contemplate module also seems fascinating :) could you help me understand it? would you include a video on that?

Anonymous's picture

'Word' Style Interface

This may be a very dumb question, but where can I find a module that will give me that 'Word' style interface you have on your body field in the video? This is what I badly need for my users, they will weep with recognition.

learnbythedrop's picture

WYSIWYG

That's called a What You See Is What You Get (WYSIWYG) editor. Please see http://learnbythedrop.com/drop/144.

Anonymous's picture

separate the embed_code from the video content

This was my first video on learn by the drop and I'm certain I will see more. Huge thanks for sharing !
The question I pose myself is how can I separate the presentation from the content. Currently in the embed_code both the video URI and code to display that video is in the same field. The URI is even duplicated into the download field. This does seem like the best design in my opinion.

Ideally I would be able to only provide the video URI (uploaded somewhere. The presentation details should be separated out I think. In case I want a different embedded player, I would not have to change each embedded code on each page.

Likely a totally different subject:
How could one best propose different delivery methods depending on the client and for instance the availability or not of Flash on the client.

learnbythedrop's picture

Presenting Embedded Video

When you ask, "...how can I separate the presentation from the content." I'm not exactly what you are trying to do. In this cased we have a link (or URI) to download a QuickTime video file and also an embed code that will display a flash player that is designed for viewing in the browser. Since I enter the embed code each time I create a post I can have a different flash player every time I write a post. So in my mind it seems to me that I've showed a way to do what you're asking. Perhaps you could clarify in a reply.

The second question is quite complicated because it requires you to have two copies of the video file on the server. And you need a player that can enforce a set of rules which will allow it to use one media type or the other. That's something a little too complicated for me to offer much advice on. Since something like 98% of browsers support flash it shouldn't really be a problem. Perhaps the easiest way to solve it is to offer a Quicktime download link as I do so that people can click on that if the flash player doesn't load.

Anonymous's picture

separate the presentation from the content

Hi Rob,
The same video is presented in 3 ways in the node:
1 : Flash
2 : Download as low quality quicktime
3 : Pay and download in high quality

I'm new to Drupal, so I don't know what is possible, but ideally I would only have to provide the high quality movie as input and let Drupal figure out all the rest, including the creation of a low quality movie file and cache it somewhere on the filesystem. The definition of the default player(s), flash, java, activeX and their default values (e.g. size) should be centralized, but with possibility to override these settings on each post. If I have a site with hundreds of video posts, and suddenly there is an issue (e.g. security) with the flashplayer, I only need to change the embed code in one place instead of changing those hundreds individual nodes. This is what I call "separation of presentation from the content".

Many photo sharing sites use such architecture: one only uploads the full size pictures, the thumbnails are generated on demand and the settings of their size defined in the presentation preferences, and at each upload of a picture (in each node). Changing the size of the thumbnails or quality on a photo library would otherwise require editing each picture's setting individually (potentially millions).

I hope this explains my question better. And please, remember I'm quite new to Drupal.

Thanks for the sharing !
Peter

learnbythedrop's picture

Drupal and Video

I think that it's important to separate functions that a system like Drupal can handle from those that require a different program altogether. In general, Drupal is not the best choice for something like encoding media using complex rules. Because while Drupal is a content management system it is not a media processing application. So modules, like ImageCache for example, can perform basic processing on images. But when you start talking about processing video then you need a lot more intelligence and processing power.

There are modules that offer options for transcoding though. They usually require either another server side program like FFMPEG or a connection to a 3rd party service that charges you to process video. The level of integration and customization varies. If you haven't already you should take a look at the following three modules to see if they might offer what you're looking for.

http://drupal.org/project/flashvideo
http://drupal.org/project/bd_video
http://drupal.org/project/kaltura

Anonymous's picture

Use field in body?

How can I reference the custom CCK fields in the body? Say I created a CCK field "nickname" and I want to be able to reference that in multiple spots in the body.

For example how would I do something like the following if I created a CCK field called "nickname":

----------
People call me $nickname. $nickname is kind of cheesy but I like people saying "Hey $nickname"......

Signed $nickname
----------

Thanks for the killer tutorials!

learnbythedrop's picture

Referencing CCK Fields

You might be able to do this with the Token module. http://drupal.org/project/token Token will allow you to reference a particular CCK field that you have created. I'm not sure if it works fully for the node body yet though. There is a discussion in the Token issue queue that might be helpful. Another approach would be to use the Contemplate module (http://drupal.org/project/contemplate) which would allow you to enter the text into a template for the field and include a php print comment that would create the dynamic portion of the sentence. See Drupal.org (http://drupal.org/handbook/customization/php-snippets) for more info on using code snippets.

Post new comment

Important
All comments on this site are moderated to prevent spam. Although we also use the Mollom module we have found that some gets through and that also affects people who have subscribed to email notifications. If you would like your comment to appear immediately please login with Google Friend Connect which supports your Google, Twitter or Yahoo account.
Google Friend Connect (leave a quick comment)
Loading
The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.