drupal-modules

Dynamically filter images in Drupal 7

自古美人都是妖i 提交于 2021-01-29 18:12:13
问题 I am trying to build a custom module in Drupal 7 that allows a user to upload an image and apply a filter. In particular, I am trying to adjust the contrast. The user can adjust the contrast via an HTML slidecontainer which will adjust the CSS contrast on the image. On submit the contrast value will be sent to the server, and applied to the image via the imagefilter() function in the GD library. My problem is that I cannot replicate the resulting CSS filter with the imagefilter() method in

show node title to unregistered users

允我心安 提交于 2020-01-06 08:41:39
问题 I'm using content access module to restrict certain nodes and node types for un-registered users. But I would like to create a view where unregistered users can also see titles of those restricted nodes. How can I do this ? 回答1: I haven't used this personally, but I just saw it pop up in the drupal.org module feed a few days ago, and it should help: http://drupal.org/project/views_ignore_node_permissions 回答2: ok if you just want to echo the node title in php (with in the node body ) enable

Cascaded select list as a custom field using hook_field_widget_form in drupal 7

做~自己de王妃 提交于 2020-01-05 08:06:02
问题 Problem I have written a Drupal custom module for a custom field. The field contains three cascaded select list. I am populating the lists using javascript. Now I need to populate it inside "hook_field_widget_form" hook. My hook_field_widget_form is as below: /** * Implements hook_field_widget_form(). */ function custom_select_list_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) { $node = menu_get_object(); $division = isset($node->field

Adding content created by custom module to drupal search index

狂风中的少年 提交于 2020-01-04 14:12:09
问题 I have developed a module to create content for my site without using CCK. The data will be saved in different tables other than the default tables of Drupal. My requirement is, how can i make Drupal to index the content created by my custom module? 回答1: You will have to implement hook_search in your module that indexes your custom content. 来源: https://stackoverflow.com/questions/4816851/adding-content-created-by-custom-module-to-drupal-search-index

drupal jQuery 1.4 on specific pages

China☆狼群 提交于 2020-01-02 05:28:10
问题 I'm looking for a way to force drupal to use 1.4 on specific pages. This is the same as this old question: drupal jQuery 1.4 on specific pages It look me a while to try the answer which I marked correct. But because I'm new to module dev overall I couldn't figure it out based on the answer. The code from that answer looked like this: /** * Implementation of hook_theme_registry_alter(). * Based on the jquery_update module. * * Make this page preprocess function runs *last*, * so that a theme

Where to declare variables common to different include files in a module - Drupal

[亡魂溺海] 提交于 2020-01-01 12:00:33
问题 I have a Drupal Module 'example'. I have split the admin and client side functionality of the module into two include files example.admin.inc and example.pages.inc. I declared constants (define()) in the example.module file, which are accessible in both the pages.inc file and admin.inc file. But how can I declare normal $variables in a centralized location so that they can be accessible in both the admin.inc file and pages.inc file. I tried to declare $variable in example.module, but couldn't

theme_table drupal development

女生的网名这么多〃 提交于 2019-12-31 05:36:05
问题 update I have made this table: I have 2 array's UGentArray and InternshipsArray. How can I set these in my table? instead of "Row column 1 data" and "Row column 2 data". My question is: I want the values from UgentArray and InternshipArray as 2 columns under Each title UGentID and Internships enter code here// Make table and display on screen. $tbl_header = array(); $tbl_header[] = array("data" => "UGentID"); $tbl_header[] = array("data" => "Internships"); $tbl_row = array(); foreach(

Drupal - dynamically add class to wrapping div based on panel pane content node type

你。 提交于 2019-12-25 07:21:27
问题 Am using the drupal 7 panels everywhere module and i have set up a panel page template for my homepage. Problem is I need to add a class to a wrapping div in the template that is dependant on the node type inside the panel pane which is inside the wrapper. This needs to be added dynamically as our site editors will be moving panel panes around a lot. i.e. a row from my template looks like this: <div class="content_wrapper"> <div id="main-content-row1" class="content"> <?php print render(

Drupal 7 date popup default value is blank

左心房为你撑大大i 提交于 2019-12-25 05:28:31
问题 I am trying to get a default value in for the default value of a date_popup that exists within a fieldset and I have followed the other suggestions here but the value is always blank. $format = 'm/d/Y'; $primary_start1 = null; if(isset($vals["primary_start"])){ if("-1" != $vals["primary_start"]){ $primary_start1 = (int)$vals["primary_start"]; } } $form['dates']['primary']['primary_start'] = array( '#title' => t('Start date'), '#name' => 'primary_start', '#type' => 'date_popup', '#date

How to work with hook_nodeapi after image thumbnail creation with ImageCache

此生再无相见时 提交于 2019-12-25 04:43:32
问题 A bit of a followup from a previous question. As I mentioned in that question, my overall goal is to call a Ruby script after ImageCache does its magic with generating thumbnails and whatnot. Sebi's suggestion from this question involved using hook_nodeapi. Sadly, my Drupal knowledge of creating modules and/or hacking into existing modules is pretty limited. So, for this question: Should I create my own module or attempt to modify the ImageCache module? How do I go about getting the generated