cck

How to get the field values of a content type in drupal

二次信任 提交于 2019-12-22 13:31:39
问题 How can I get the field value of a custom content type. I have created a custom content type using the CCK module. Is there any function to get the array of the fields of a particular content type. For example: I can get the profile details using content_profile_load() function. Is there any function similar to this. 回答1: If you are viewing the node, the values are all stored in the $node variable. Do a print_r($node); to see all the available values in the node object. Otherwise use node

Add CCK field to custom form in Drupal 7

喜夏-厌秋 提交于 2019-12-22 07:02:58
问题 There was a method with CCK in Drupal 6 to attach a CCK field in our custom form, like: $field = content_fields('field_name'); // field_name is cck field (text_field,text_Area,image_field anything.) $form['#field_info'][$name] = $field; $form += content_field_form($form, $form_state, $field); How can I achieve the same functionality in Drupal 7? I had a form and I want to use the field that I created for a content type. I went through all the files of field.module but couldn't find anything.

Add CCK field to custom form in Drupal 7

為{幸葍}努か 提交于 2019-12-22 07:02:14
问题 There was a method with CCK in Drupal 6 to attach a CCK field in our custom form, like: $field = content_fields('field_name'); // field_name is cck field (text_field,text_Area,image_field anything.) $form['#field_info'][$name] = $field; $form += content_field_form($form, $form_state, $field); How can I achieve the same functionality in Drupal 7? I had a form and I want to use the field that I created for a content type. I went through all the files of field.module but couldn't find anything.

How do you migrate CCK fields between environments in Drupal?

拟墨画扇 提交于 2019-12-21 05:44:09
问题 The Content Construction Kit (CCK) is one of the most useful Drupal modules. It allows you to easily add custom fields to a content type. However, these new fields are created through Drupal itself and stored in the database. This means that if you change a CCK field in your development environment you need to manually make the same change in your test and production environments. Worse, there's no simple way to determine if your environments have gotten out of sync. So if you ever

'add another item' in non-CCK Drupal forms

亡梦爱人 提交于 2019-12-21 04:58:08
问题 CCK for Drupal has the handy feature of allowing a single CCK field to accept multiple values via a "add another item" button that results in an array of data in the node. I'm wondering if there's any easy way of adapting this for a non-CCK form that I'd be calling by drupal_get_form . I'd rather not have to re-invent the wheel with multi-step form techniques. Anyone done this? 回答1: It would be nice if they had included a more reduced example, but this Introduction to AHAH in Drupal, along

multi step form with upload & save to node type

为君一笑 提交于 2019-12-20 06:15:06
问题 im trying about a week to do multistep form usin form api in drupal 6 and in the step 2 there is 2 upload fields and then its should proceed until step 5, after user fill the step 1 he can skip the whole form and submit the data... im trying to do it and im not success, i glue some pices of code and its not work , and multiform plugin is kinda buggy anyone did something like that and can share the code or just explain me what functions i should use and how? 回答1: Try multiform, but be careful

Is it possible to customise drupal node reference and pass your search and a argument from another field

谁说胖子不能爱 提交于 2019-12-13 12:14:32
问题 I'm trying to create a bespoke form in drupal, with a node reference field. I'd like to add a little extra functionality to the node reference auto complete. I've created a view, that contains an argument. I'd like to be able to pass that argument from a drop down as well as the typed text into the autocomplete script. Does anyone know how I'd start this off. /* FIELD 1 - the drop down */ $sql = "SELECT nid, title FROM node where type='resourcetype' AND status =1 order by title "; $result =

Drupal: Associating grouping more than one CCK field

家住魔仙堡 提交于 2019-12-13 07:09:55
问题 I have an article content type with a node reference CCK field that links to other articles (related articles) . I need to add a text field for each node reference that allows an admin to specify "why it's related". How do I go about this in D6? Articles can be related with other articles so it makes sense to have the "why it's related" to go in the main article referencing the related articles. This is using the text area type ahead so that the user will be given teh drag and drop UI for

How to show CCK field in search result?

China☆狼群 提交于 2019-12-13 02:59:32
问题 How to display custom CCK field (text or imagefield) in Drupal core search results page? 回答1: You need to override search-result-tpl.php in your theme. Copy it from modules/search to your themes directory, clear the theme cache, and you're set. You'll see that there is an array available to the theme file called 'result', which contains a bunch of data, including a node object. So your file becomes something like: <dt class="title"> <a href="<?php print $url; ?>"><?php print $title; ?></a> <

Simulated click on “add more value” button of multi value cck field causes whole content form to submit

扶醉桌前 提交于 2019-12-12 04:31:29
问题 Hi I have a multi value cck field in my cck content type. I want to simulate click on "add another item" using jquery. which is like $('#edit-field-supp-quan-field-supp-quan-add-more').trigger('click'); but it causes whole content form to submit instead of adding extra multi value cck field. Manuall clicks are working perfectly. Can anyone tell me why behavior of manual clicks and simulated clicks are different. thanks ----Update ---- This is the code I was using:- $('#edit-field