• For creating block via code you need to  call block hook.
    function <modulename>_block($op = 'list', $delta = 0) {
        $block = array();
        if($op == 'list') {

            $block[1]["info"] = t(ucfirst('First Block'));
            $block[2]["info"] = t(ucfirst('Second Block'));

        } else if ($op == 'view') {
            switch ($delta) {
            case 1:

                $block['subject'] = ucfirst('First Block');
                $block['content'] = '...

    Tags:
    Drupal
  • Here I call ajax funtion in drupal. You can freely called your js in any drupal function.

    whenver your function will run this js will auto add.

    $js = " jQuery(document).ready( function( ) {
               $.ajax({
                           url: '{$base_url}<your URL>',
                           success: function(data) {
                                                                    $('<div id>').html(data);...

    Tags:
    Drupal
  • Hello,

        To show you description text with drupal form you have to use drupal_get_form hook.(in drupal 6)

    function <your function name>{

      $output  = "your Dummy text will be show top of form";
      $output .= drupal_get_form('<your form name>');
      $output .= "your Dummy text will be show bottom of form";

      return $output;
     }

    For drupal 7 method will slitly change.

    $output .= drupal_render(...

    Tags:
    Drupal

Pages

X