drupal-6

Drupal 6: best practice for changing contributed module's JavaScript

六月ゝ 毕业季﹏ 提交于 2019-12-08 05:00:55
问题 I've a question about how to customize drupal modules avoiding hacks. Let's say I've downloaded Lightbox2 module and I want to change the javascript file to display differently my lightbox. At the moment I'm modifying the Lightbox2 module, so I cannot update it anymore, so I know it is not the best practice. I was wondering if I can customize the javascript file of this module with a hook, and how. Thanks 回答1: To alter just the JS, you shouldn't need to hack the module at all. Instead, you

Change form data after submit in drupal

梦想与她 提交于 2019-12-08 04:07:24
问题 in some content type form I added a checkbox. When this checkbox is checked I want to remove some of the submitted data. To do so I created a custom module (my_module.module): function my_module_form_alter(&$form, &$form_state) { // ... $form['#submit'][] = 'my_module_form_alter_submit'; } function my_module_form_alter_submit($form_id, $form_values) { drupal_set_message(t('Submit Function Executed!')); } How can I tell this module to refer only to the form of a certain containt type? And how

Javascript / jQuery loading (conflict)

不想你离开。 提交于 2019-12-08 03:17:08
问题 I'm trying to load in a few jQuery files, a drupal 6 slideshow, flexslider carosel, modernize and a bootstrap modal. I would just like to say I am including jquery from google cdn and putting a no conflict to load the flex slider - if I take the flexslider load away the Slideshow works. Weird. <script type="text/javascript"> $.noConflict(); jQuery(window).load(function() { jQuery('.flexslider').flexslider({ controlNav: false, animation: "slide", animationLoop: false, itemWidth: 162,

How remove node ID [nid:n] in NodeReference fields

给你一囗甜甜゛ 提交于 2019-12-08 01:56:15
问题 This is the same question of this link: Removing [nid:n] in nodereference autocomplete According with the first answer (Grayside) I've created my own module and activated. Then I create a new content, I look sth up in the nodereference field and finally select it -> it works (Doesn't appear the [nid:n]). But, when I view/preview or save or edit the content, the [nid:n] appears again. Anybody can help me? 回答1: When viewing the node, it is the theming function for the field that determines what

Search hook for filtering results?

*爱你&永不变心* 提交于 2019-12-07 21:23:43
问题 I have been going through the docs and source code looking for something without luck. Is there a Drupal 6 hook that gets called after hook_search(), but before the $results gets handed off to the template system? I need to do a fairly custom pruning and reordering of results that get returned. I could just reimplement hook_search(), but this seems like overkill. Thanks. 回答1: There isn't; search_view() (which displays the results) calls search_data(), which invokes hook_search() then

Taxonomy view with nodes

佐手、 提交于 2019-12-07 16:10:18
问题 Using Drupal 6, I'm trying to create a page with views that shows something like the following: -Taxonomy Term 1 -- Title and description of a node that contains this term -- Title and description of a node that contains this term -Taxonomy Term 2 -- Title and description of a node that contains this term -- Title and description of a node that contains this term -Taxonomy Term 3 -- Title and description of a node that contains this term -- Title and description of a node that contains this

hook_user(): inserting extra field into database not just form

十年热恋 提交于 2019-12-07 15:31:11
问题 I can add an extra field to the registration. What I need to know is what step do I need to take to then grab that input and insert it into the user table of drupal. The code below is in my module this adds just a field to the form, but when its submitted it doesnt do anything with the data. function perscriptions_user($op, &$edit, &$account, $category = NULL){ if ($op == 'register') { $form['surgery_address'] = array ( '#type' => 'textarea', '#title' => t('Surgery Address'), '#required' =>

how to override Drupal path from another module

独自空忆成欢 提交于 2019-12-07 14:46:04
问题 I want my module to override the path was set by another module Example: Module A has register a path: $menu['node/%id/test'] = array( 'title' => 'Test', 'page callback' => 'test_A', 'page arguments' => array(1), 'access callback' => 'test_access', 'access arguments' => array(1), 'type' => MENU_LOCAL_TASK, ) Now I create module B and register the same path. $menu['node/%id/test'] = array( 'title' => 'Test', 'page callback' => 'test_B', 'page arguments' => array(1), 'access callback' => 'test

Drupal: multilanguage.. looking for the right module to build multiple versions of the node

霸气de小男生 提交于 2019-12-07 08:39:32
I have a multi-language website. I want a module to add multiple version of my nodes and selecting the right one for each language of my website. In other terms, for each node, I want to have more versions, a version for each language. I don't want to create new nodes, in order to avoid confusion for my customer. I want to be able to fill the content for each language version of the same node. If I'm not wrong, the core module Content Translation allows me to select for each node to which language interface belongs to, which is not what I want. I saw the internationalization module, and it is

Drupal Exposed Views Filter custom date

谁说胖子不能爱 提交于 2019-12-07 08:29:03
问题 I have a date filter that I have exposed on my view. I want to make the interface more user friendly and tighten up the look of it. Instead of selecting a date I would like to select from the following options. The last day The last week The last year All This would then filter on the date field. Is this possible? How would you go about doing this? 回答1: The proper way to do it is to alter the form in a custom module using hook_form_alter: function YOURMODULE_form_alter(&$form, $form_state,