Drupal Blog

Drupal 7: How to remove "More information about formatting options" link

The code below goes in your template.php and removes the "More information about formatting options" link.

<?php
/**
 * Remove the comment filters' tips
 */
function MyThemeName_filter_tips($tips, $long = FALSE, $extra = '') {
  return
'';
}
/**
 * Remove the comment filter's more information tips link
 */
function MyThemeName_filter_tips_more_info () {
  return
'';
}
?>

Please remember to clear the cache in order for the changes to trigger.

Drupal 7: Hide a field depending on the value of a checkbox

I recently had the requirement to hide a horizontal tab in node display depending on the value of a checkbox i.e. Show tab X. For the horizontal tabs I was using the excellent Fieldgroup module.

In order to achieve the above, I created a little custom module and used the newly introduced in drupal 7 hook, hook_node_view_alter.

blog: 

Drupal 7: Add a custom link in admin menu

Here is some code to be used in a custom module in Drupal 7 in order to create a custom link in the admin menu. This item will show up in the Configuration section and it is particularly useful with the administration menu module.

blog: 

Drupal: Send file programmatically

Here is a handy, general function for Drupal 6 that takes as an argument a file id and returns the file for downloading.

Drupal Commerce - "Select a product" element: How to change the select list to radio buttons

Here is the code that changes the default select list of "Select a product" element of Drupal Commerce to radio buttons, for a standalone product list.

The following goes in a custom module (tested in Drupal 7).

<?php
function MYMODULE_form_alter(&$form, $form_state, $form_id) {
  if (
strpos($form_id, 'commerce_cart_add_to_cart_form_') === 0 && isset($form['product_id'])) {
   
$form['product_id']['#type'] = "radios";   
  }
}
?>

Recent Comments

Forward by Dries Buytaert, Founder and Project Lead, Drupal; CTO Acquia.

Order now from:

Managing Expectations Podcast with DrupalEasy

Author Interview http://tinyurl.com/8a8nxno

We provide the most Shiny Drupal Bits & Pixels

Since Drupal 4.x