drupal-7

@fontface in IE7 (IETEster) not working properly

巧了我就是萌 提交于 2019-12-06 06:03:51
I am using the Sansumi @fontface kit by Fontsquirrel.com. It works properly in IE6 and IE8 in the program IETester, but in IE7, it doesnt. My CSS Code looks like this: @font-face { font-family: 'SansumiExtraBoldRegular'; src: url('../fonts/Sansumi-ExtraBold-webfont.eot'); src: url('../fonts/Sansumi-ExtraBold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Sansumi-ExtraBold-webfont.woff') format('woff'), url('../fonts/Sansumi-ExtraBold-webfont.ttf') format('truetype'), url('../fonts/Sansumi-ExtraBold-webfont.svg#SansumiExtraBoldRegular') format('svg'); font-weight: normal; font

Drupal 7: Pathauto hierarchical taxonomy terms pattern

依然范特西╮ 提交于 2019-12-06 05:06:55
问题 I have a Drupal 7.9 taxonomy vocabulary according to the following scheme: category-1 category-1 > subcategory-1-1 category-1 > subcategory-1-2 category-1 > subcategory-1-3 category-2 category-2 > subcategory-2-1 I want to reflect this taxonomy hierarchy in my page url path like category-1/subcategory-1-1/page-123 To achieve this I'm using the modul Pathauto version 7.x-1.0. but I don't know which pattern I have to use. Currently I'm using [node:%field_taxonomy%]/[node:title] but with this

Remove stylesheet selectively in Drupal for page

人盡茶涼 提交于 2019-12-06 04:38:53
问题 I am trying to make different layout for the front page. In that process I declared new stylesheet called "front-page.css" and page--front.tpl.php. I am using a Zen subtheme which loads responsive-sidebar.css. I want to remove "responsive-sidebar.css" and load "front-page.css". The reason I am doing it because the number of grind columns in the later stylesheet is different that former. I don't want to use Panels module. I am using Drupal 7. 回答1: The Drupal 7 way is to use hook_css_alter():

how to send email in drupal 7

守給你的承諾、 提交于 2019-12-06 04:22:43
问题 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

Drupal: assign roles in user_save

谁都会走 提交于 2019-12-06 03:55:32
问题 I can't find a solution or right example for something that should be quite simple: assign a role to an user when creating it, this is what I'm trying: $edit = array( 'name' => $_POST['name'], 'pass' => $password, 'mail' => $_POST['email'], 'status' => 0, 'language' => 'es', 'init' => $_POST['email'], array(2 =>'authenticated', 4=>'my custom role') //as id and named in role db table ); user_save(NULL, $edit); The user is not being created, how can I do this? Thank you 回答1: You haven't named

ckeditor strips <span> and style attributes

血红的双手。 提交于 2019-12-06 02:57:59
问题 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

Alter messages in Drupal 7

▼魔方 西西 提交于 2019-12-06 02:31:58
There is a couple of messages in drupal. When there is a php warning, an error message is raised, but a module can also raise messages with drupal_set_message(). The question is: Is there a way to alter these messages? For example to replace every 'a' with 'b' in every message. Thanks! While there is no message alter on set, you can change them on display via hook_preprocess_status_messages , see http://api.drupal.org/api/drupal/includes--theme.inc/function/theme/7 on preprocess and http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_status_messages/7 . Edit: also you can try

Drupal 7: Rename files on upload (via filefield)

浪尽此生 提交于 2019-12-06 00:44:19
I am looking for a way to rename files that are uploaded by users through a filefield. For example, rename user profile photos using uniqid . I found a good solution for D6 at " Drupal 6: How to Change Filename on Upload " but can't find anything for D7. Another option is to use File (Field) Paths , but: The module causes warnings on my setup. Seems to be a bit of an overkill to install a general module for a very specific purpose. You can change every file upload by hook_file_presave as your desire pattern as example function yourmodulename_file_presave($file) { $parts = pathinfo($file-

Where is the user's picture stored in Drupal 7?

佐手、 提交于 2019-12-06 00:23:53
I'm using a SelectQuery object to retrieve and display a list of users, but I don't know where to get the user's picture from. The users table has a column called picture, but the data in there is just an integer. Is the picture stored in a blob field somewhere or is there a link to the picture in another table? The image file itself is stored (usually) somewhere in /sites/default/files . The reference to that image is stored in the file_managed table, the picture column in the users table contains the fid (file id) of the picture. You can load the file object like this: $file = file_load($fid

Drupal 7 - add HTML inside #link form type entry?

我是研究僧i 提交于 2019-12-05 21:28:31
I need to add HTML markup to the #title field of a Drupal 7 #type link form element. The output should look roughly like this: <a href="/saveprogress/nojs/123" id="saveprogress-link" class="ajax-processed"> <span data-icon="" aria-hidden="true" class="mymodule_symbol"></span> Save Progress </a> Since I'm doing some ajax forms, I can't just use #markup and l() function. Here's an example without the span: function mymodule_save_progress_link($nid) { return array( '#type' => 'link', '#title' => t('Save Progress'), '#href' => 'saveprogress/nojs/' . $nid, '#id' => 'saveprogress-link', '#ajax' =>