drupal-7

How to render a Youtube thumbnail in a template in Drupal 7

ⅰ亾dé卋堺 提交于 2019-12-04 11:24:21
问题 I am using the following modules: media media_youtube Styles and would like to render a thumbnail of a Youtube video in a template (.tpl). Which theme function should I use and with what params? My best quess would be something like: $my_media['style_name'] = 'unlinked_thumbnail'; print theme('file_styles',$my_media); where $my_media is an array containing fid,uri,filename,filemime etc. Since i'm very new to Drupal, all my attempts to make sense of the modules source code have failed. I feel

PHP arrays… What is/are the meaning(s) of an empty bracket?

拟墨画扇 提交于 2019-12-04 09:21:35
I ran across some example code that looks like this: $form['#submit'][] = 'annotate_admin_settings_submit'; Why is there a bracket after ['#submit'] that is empty with nothing inside? What does this imply? Can anyone give me an example? Normally (from my understanding which is probably wrong) is that arrays have keys and in this case the the $form array key '#submit' is equal to 'annotate_admin_settings_submit' but what is the deal with the second set of brackets. I've seen examples where an array might look like: $form['actions']['#type'] = 'actions'; I know this is a very basic question

how to send email in drupal 7

走远了吗. 提交于 2019-12-04 09:15:58
Does any can help with an example source code to send email in drupal 7. Can any one help with the contact_submit function to use drupal_mail() . I'm using custom module : function contact_menu() { $items['contact'] = array( 'title' => 'contact form', 'page callback' => 'drupal_get_form', 'page arguments' => array('contact_form'), 'access arguments' => array('access content'), ); return $items; } function contact_form() { $form['intro'] = array( '#markup' => t('Use this form to send a message to an e-mail address. No spamming!'), ); $form['email'] = array( '#type' => 'textfield', '#title' => t

Safari 5.1 breaks CSS table cell spacing

余生颓废 提交于 2019-12-04 08:20:18
My site was working fine across all major browsers right up until the update to Safari 5.1. Now, the primary navigation is busted up. I was using display:table-cell on the anchor element within the list element and was also using the font-size:0 hack to remove the spacing in between menu elements. Has anyone else encountered this issue and have a solution they could offer up? Before: After: CSS: #navigation { padding-top: 7px; } #navigation ul.links, /* Main menu and secondary menu links */ #navigation .content ul /* Menu block links */ { margin: 0; padding: 0; display: block; font-size: 0; /*

ckeditor strips <span> and style attributes

淺唱寂寞╮ 提交于 2019-12-04 08:12:43
I have a Drupal 7 site using ckeditor 4.2. I've created a basic page node and put a span inside an h2 heading in the body. I hard coded it in the html view. It looks fine but if I go back to edit the page, my has gotten stipped out of the html and also any style="" I've put into the html also. I've looked at the ckeditor config and text-formats. I've set the only formats allowed to be text and full html so I'm not using filtered at all. What gives? I've used the editor many times before but probably not this version. If you are using the CKeditor module then there is an option in Advanced

Delete field_group programmatically

流过昼夜 提交于 2019-12-04 07:46:50
I have a field_group called "group_imagecache" in Drupal 7. How would I delete this programmatically? I have tried reading the code and it seems it uses ctools, but I would rather not use ctools. ctools is a dependency of field_group. If you want to interact with field groups programmatically, you'll need to do so through ctools' API. Fortunately, it isn't hard in this case. Something like the following should work: if ($group = field_group_load_field_group($group_name, $entity_type, $bundle_name, $mode)) { ctools_include('export'); field_group_group_export_delete($group, FALSE); } Just grep

How to change footer Powered by Drupal and its link?

Deadly 提交于 2019-12-03 23:15:15
I am working on Drupal. I want to know how to change that footer text Powered by Drupal and link given to it. I want there "Copyrights 2012 (My site name).All Rights reserved." I can not getting it can any one help me. Just go to Structure -> blocks -> Add block Leave block title blank block description Custom Footer or any other if you want and in Block body add following code Copyrights © <a href="http://localhost/drupal-7.12/">TopTableToastMaster</a>.All right reserved. After doing this set default footer's region as none and add your custom footer. Hope this will solve your problem. Just

Drupal 7 password hash

二次信任 提交于 2019-12-03 21:48:13
I have a bit of a dilemma here. I have a drupal 7 database table of users, with corresponding passwords. All these passwords have been naturally encrypted. My assumption is that these are MD5 hashes, but not quite. The challenge here is that, we are utilizing the same set of users in a companion website that uses similar credentials but a different technology [please don't blame me for this, I a mere pawn]. Now if I knew how Drupal goes about encrypting its passwords, maybe I could decrypt them and apply the same in my backend logic? Note that these passwords are hashed , not encrypted. The

Drupal 7 Views - list group by field

☆樱花仙子☆ 提交于 2019-12-03 21:13:38
问题 I have a View that list content of type Bio (the biographies of people). However, I would like to format it so that they are grouped under different headings. I added a new field to the Bios content type which is a dropdown list with three different options - Foo , Bar and Baz . What I want to do is display the people under the heading of their respective group. Currently: - John Doe - Jane Doe - Jack Doe - Juanita Doe - Jim Doe What I want: #Foo - John Doe - Jane Doe #Bar - Jack Doe -

Add Class to Image Field in Drupal 7

蹲街弑〆低调 提交于 2019-12-03 21:02:11
I have added an image field to content type "Basic Page" and using the "Manage Displays" option have it displayed at the top of the page. However there is no styling on the image and I can't for the life of me figure out how I add a class to the image so that I can add styles. If you're using CCK there's almost certainly a class already associated with the image (or at least a class on a div that wraps it). CCK wraps just about everything in a class. Try right clicking the image and clicking on Inspect Element to double check. If you really need to add a class though, you can use the Theme