drupal-7

drupal 7 views sub tabs not working

强颜欢笑 提交于 2020-01-05 09:28:29
问题 hello i am experience a problem and need some help if possbile. i am using views 3 and i can make tabs normally on specific content types. what i want so is to have a sub tab under the existing tab on my content type. i am following the procedure as descibed on views to make another view and add tab as default menu tab i give a name and then i select already exists on the parent meny item select list. my sub menu not showing for this view . I then try to make a module to make this to show up

jQuery not rendering properly

瘦欲@ 提交于 2020-01-05 09:07:25
问题 I'm using this jQuery to render a text box onClick. But, It's not rendering... Also, on a side note I'm using Drupal 7. I have the jQuery in the Head tags of the html.php. <script type="text/javascript"> $(document).ready(function() { $("#front-background").hide(); $(window).load(function() { $('#links-top-1').hover(function() { $('#front-background').fadeIn(2000); }); }); }); </script> 回答1: This may also be because of how Drupal handles compatibility with other JavaScript libraries. You can

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

.htaccess path only accessible by ip

安稳与你 提交于 2020-01-04 11:02:34
问题 I would like to block a path from my site using the .htaccess configuration. The idea is that only a specific set of IP's can access that specific path from the URL. Note: It's a path, not a page or directory. We are trying to shield off a web-service so there will be only post calls to the URL's. I would like the url example.com/rest to be blocked and everything behind that url based on IP. So example.com/rest/test_service and example.com/rest/test_service/read should be blocked. All other

.htaccess path only accessible by ip

大兔子大兔子 提交于 2020-01-04 11:01:53
问题 I would like to block a path from my site using the .htaccess configuration. The idea is that only a specific set of IP's can access that specific path from the URL. Note: It's a path, not a page or directory. We are trying to shield off a web-service so there will be only post calls to the URL's. I would like the url example.com/rest to be blocked and everything behind that url based on IP. So example.com/rest/test_service and example.com/rest/test_service/read should be blocked. All other

Adding url() breaks hook_mail implementation

此生再无相见时 提交于 2020-01-03 19:02:13
问题 I'm writing a module in Drupal-7 that dynamically sends a one-time login link to guests. Everything fires fine until I add the link to the $message array, when it chokes. If I do a dpm($message) the link appears in the $message['body'] array, as I would expect. If I comment out the line with the url() function, everything works as it should. Why is php/Drupal choking on this silly little link? /* * Implement hook_mail(). */ function rsvp_mail($key, &$message, $params) { switch($key) { case

Drupal field_settings_form

醉酒当歌 提交于 2020-01-03 03:21:08
问题 I made my own Field in Drupal for an address. It displays things like street, number, zip,... So far so good. But for some reason, ALL field are required. Although there are set required in the UI or the Array. So I would like to edit it's field_settings_form. I found myself an example in the Drupal-core code, but it doesn't help me a lot. Goal of the field_settings is to make the fields visible or not and required or not. So I came up with this code (I got it from user_reference.module )

Valid access arguments

心已入冬 提交于 2020-01-02 10:02:29
问题 How can I look up the valid access arguments? I looked in menu_router, but I believe that only gives some of them. $items['admin/page'] = array( 'access arguments' => array('access administration pages'), ); 回答1: Invoke hook_permission() across all modules: $permissions = module_invoke_all('permission'); If I remember rightly array_keys($permissions) will then give you a list of valid permission machine names. The labels/descriptions/other settings for each permissions are in each individual

Drupal 7 | update multiple rows using db_update

僤鯓⒐⒋嵵緔 提交于 2020-01-02 05:22:07
问题 I have an array like Array ( [1] => 85590762,22412382,97998072 [3] => 22412382 ) Where key is the item_id and value is the value of a column which I need to update against an item. I can use db_update in a loop but i want to avoid this strategy due to performance. I want to update all the rows in a single db call. Also using db_query I think will not be a good idea. So is there any way using db_update to update these rows? According to above data, standard mysql queries will be like update

How can I upload multiple files with drupal 7?

大兔子大兔子 提交于 2020-01-01 19:18:36
问题 I'm making a drupal 7 module that contains a form and I would like to upload multiple files in a row. Currently I'm using a managed_file type of input field. $form['attachment'] = array( '#title' => t('Attachment'), '#type' => 'managed_file', '#default_value' => variable_get('attachment', ''), '#upload_location' => 'public://perm/', ); This gives me the upload button, but only lets me upload one file. Is there a way I can tell this form to upload a file and still keep the option for a second