cck

Removing [nid:n] in nodereference autocomplete

只谈情不闲聊 提交于 2019-12-03 02:50:59
问题 Using the autocomplete field for a cck nodereference always displays the node id as a cryptic bracketed extension: Page Title [nid:23] I understand that this ensures that selections are unique in case nodes have the same title, but obviously this is a nasty thing to expose to the user. Has anyone had any success in removing these brackets, or adding a different unique identifier? 回答1: Ultimately, you need to change the output of nodereference_autocomplete() in nodereference.module. To do this

How do I hide a CCK Nodereference input widget in #after_build?

…衆ロ難τιáo~ 提交于 2019-12-02 20:01:09
问题 I like simplifying the node form. One of my tricks in the past has been to conditionally hide CCK elements on new node creation when I want to enforce some kind of default. One of my favorite tricks is to whisk away things put in place by the Prepopulate module. Unfortunately for me, it's recent move to an #after_build -based mechanism seems to be creating all kinds of collisions in how I can manipulate the widget. This is what I used to do in hook_form_alter() : $form['field_my_nodereference

Removing [nid:n] in nodereference autocomplete

半腔热情 提交于 2019-12-02 16:24:25
Using the autocomplete field for a cck nodereference always displays the node id as a cryptic bracketed extension: Page Title [nid:23] I understand that this ensures that selections are unique in case nodes have the same title, but obviously this is a nasty thing to expose to the user. Has anyone had any success in removing these brackets, or adding a different unique identifier? Ultimately, you need to change the output of nodereference_autocomplete() in nodereference.module. To do this properly, you want a custom module to cleanly override the function. This function is defined as a menu

How do I hide a CCK Nodereference input widget in #after_build?

拟墨画扇 提交于 2019-12-02 12:21:10
I like simplifying the node form. One of my tricks in the past has been to conditionally hide CCK elements on new node creation when I want to enforce some kind of default. One of my favorite tricks is to whisk away things put in place by the Prepopulate module. Unfortunately for me, it's recent move to an #after_build -based mechanism seems to be creating all kinds of collisions in how I can manipulate the widget. This is what I used to do in hook_form_alter() : $form['field_my_nodereference_field'][0]['#type'] = 'hidden'; $form['field_my_nodereference_field'][0]['#value'] = $form['field_my

multi step form with upload & save to node type

倾然丶 夕夏残阳落幕 提交于 2019-12-02 08:36:41
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? Try multiform, but be careful as it is still in dev state. If you want to do it on your own, have a storage variable called step in the

Auto-updating width/length/area using jQuery and Drupal6

社会主义新天地 提交于 2019-12-01 13:57:41
I'm using Drupal to create a measurement sheet ( Measurement sheets in Drupal 6 ) and am at a point where I have all the fields in place, I just need to write some jQuery that auto-updates the appropriate field when the user enters data. Code below: jQuery(document).ready( function ($) { $('input').change( function() { $parent = $(this).parent("td").children("div").children("div"); length = $parent.children("div[id*='field-length-0-wrapper']").children("div.container-inline").children('div[id*="field-length-0-value-wrapper"]').children('input[id*="field-length-0-value"]').val(); // get the

Saving nodes with a filefield

旧城冷巷雨未停 提交于 2019-12-01 10:59:15
I'm in the progress of creating a bulk upload function for a Drupal site. Using flash I'm able to upload the files to a specific url that then handles the files. What I want to do, is not just to upload the files, but create a node of a specific type with the file saved to a filefield that has been setup with CCK. Since these are audio files, it's important that filefield handles the files, so addition meta data can be provided with the getid3 module. Now I've looked through some of the code as I wasn't able to find an API documentation, but it's not clear at all how I should handle this.

Saving nodes with a filefield

南笙酒味 提交于 2019-12-01 07:57:00
问题 I'm in the progress of creating a bulk upload function for a Drupal site. Using flash I'm able to upload the files to a specific url that then handles the files. What I want to do, is not just to upload the files, but create a node of a specific type with the file saved to a filefield that has been setup with CCK. Since these are audio files, it's important that filefield handles the files, so addition meta data can be provided with the getid3 module. Now I've looked through some of the code

Creating Drupal CCK content programmatically/ via API

大兔子大兔子 提交于 2019-11-30 14:43:57
I am working with a Drupal 6.x system to create exercise / personal training programmes, and am using the CCK with content types of Exercise and Programme, where Programme contains a few header fields and a list of node references to the exercises it consists of. This works great and I can manually create programmes which work fine. I now wish to create a module which can generate these programs automatically based on a number of algorithms I have developed, the process will look like: Load all exercises into array Load users personal info (entered previously) Establish best suited exercises

Drupal 7: how to restrict file access to specific user roles

邮差的信 提交于 2019-11-29 02:25:44
I need to develop a site on Drupal 7. I have some content types with File fields in CCK. And access to nodes of these types should be granted only to specific Drupal user role. And at any moment site administrator should be able to make these Nodes 'public' or 'private'. I can make nodes visible only to specific user roles, but this is not secure enough. If anonymous user knows the path to file ( www.mysite.org/hidden_files/file1 ), he can download it. What is the most elegant way to solve this problem? Thanks in advance. Check out this documentation here: http://drupal.org/documentation