custom module

Module for feature Block

  1. <?php
  2. /**
  3.  * Implements hook_block_info().
  4.  */
  5. function feature_block_info() {
  6.   $blocks['feature'] = array(
  7.                              'info' => t('Featured Content'),
  8.                      

Fix for this custom module to show a block does not show a block :)

  1. <?php
  2. // $Id: my_module.module
  3.  
  4. /**
  5. * @file
  6. * Custom functions for this site.
  7. */
  8.  
  9. /**
  10. * Implementation of hook_block().
  11. * Adds a block that has new text.
  12. */
  13.  
  14. function new_block($op = 'lis

this custom module to show a block does not show a block :)

  1. <?php
  2. // $Id: my_module.module
  3.  
  4. /**
  5. * @file
  6. * Custom functions for this site.
  7. */
  8.  
  9. /**
  10. * Implementation of hook_block().
  11. * Adds a block that has new text.
  12. */
  13.  
  14. function new_block($op = 'lis

Theming node add form: filling automatically the field "menu link title" with the title of the node

  1. function test_module_form_alter(&$form, $form_state, $form_id) {
  2.   if ($form_id == 'node-type_node_form') {
  3.     $form['menu']['link_title']['#default_value'] = $form['title'];
  4.   }
  5. }

Fix for Custom Company Info for Theming

  1. <?php
  2. // $Id:
  3.  
  4. function system_custom_menu() {
  5.        
  6.         $items = array();
  7.        
  8.         $items['admin/settings/site-additional-info'] = array(
  9.                 'title' => t('Additional Site Information'),
  10.                 'page callback'

Fix for Custom Company Info for Theming

  1. <?php
  2. // $Id:
  3.  
  4. function system_custom_menu() {
  5.        
  6.         $items = array();
  7.        
  8.         $items['admin/settings/site-additional-info'] = array(
  9.                 'title' => t('Additional Site Information'),
  10.                 'page callback'

Custom Company Info for Theming

  1. <?php
  2. // $Id:
  3.  
  4. function system_custom_menu() {
  5.        
  6.         $items = array();
  7.        
  8.         $items['admin/settings/site-additional-info'] = array(
  9.                 'title' => t('Additional Site Information'),
  10.                 'page callback'

Fix for Simple code to load default views

  1. /**
  2.  * Implementation of hook_views_default_views().
  3.  */
  4. function mymodule_views_default_views() {
  5.   $views = array();
  6.  
  7.   $files = file_scan_directory(drupal_get_path('module', 'mymodule').'/v

Simple code to load default views

  1. /**
  2.  * Implementation of hook_views_default_views().
  3.  */
  4. function mt_views_default_views() {
  5.   $views = array();
  6.  
  7.   $files = file_scan_directory(drupal_get_path('module', 'mymodule').'/views',

How to printout $output in drupal!

  1. <?php
  2.  
  3. function test_perm() {
  4.   return array('administer custom test block');
  5. }
  6.  
  7. function test_menu() {
  8.   $items = array();
  9.   $items['user/%/test/read'] = array(
  10.     'title' => 'Read',
Syndicate content