I would like to start by appologising for what may seem the obvious.
I am still learning drupal, but would ask for some help.

Currently on the route page I have the map on the left and the route on the right. I would like the route to be under the map.

If you are to explain how I can do this in very simple terms if possible that would be great.

Thankyou very much

Comments

hutch’s picture

Your theme should have a template.php, copy the function theme_getdirections_show() from getdirections.theme.inc to your template.php, renaming it appropriately, eg from theme_getdirections_show mythemename_getdirections_show where 'mythemename' is the name of your theme. Then change the following:

  $rows[] = array(
    array(
      'data' => '<div id="getdirections_map_canvas" style="width: '. $width .'; height: '. $height .'" ></div>',
      'valign' => 'top',
      'align' => 'center',
      'class' => 'getdirections-map',
    ),
    array(
      'data' => ($getdirections_defaults['advanced_alternate'] ? '<button id="getdirections-undo" onclick="getdirectionsundo()">' . t('Undo') . '</button>' : '') .'<div id="getdirections_directions"></div>',
      'valign' => 'top' ,
      'align' => 'left',
      'class' => 'getdirections-list',
    ),
  );

to

  $rows[] = array(
    array(
      'data' => '<div id="getdirections_map_canvas" style="width: '. $width .'; height: '. $height .'" ></div>',
      'valign' => 'top',
      'align' => 'center',
      'class' => 'getdirections-map',
    ),
  );
  $rows[] = array(
    array(
      'data' => ($getdirections_defaults['advanced_alternate'] ? '<button id="getdirections-undo" onclick="getdirectionsundo()">' . t('Undo') . '</button>' : '') .'<div id="getdirections_directions"></div>',
      'valign' => 'top' ,
      'align' => 'left',
      'class' => 'getdirections-list',
    ),
  );

What this does is rearrange the table so that it produces two rows with one datacell each instead of one row with two datacells.

Make sure you flush the theme registry when you have made the changes, the devel and admin_menu modules are helpful for this.

pmflav’s picture

Worked perfectly. Thankyou very much for the instructions, have tried a couple of other little tweaks using your guide and they also worked great.

Thankyou very much for taking the time to explain and show me this.
This is why I love the drupal community.

blamege1’s picture

How is accomplished in drupal 7? I really need to move the directions results under the map. Any suggestions?

hutch’s picture

Getdirections in D7 has the same theme functions as D6, just follow the instructions in #1

blamege1’s picture

Got it, much appreciated. I was forgetting to close out the initial $rows[] = array(

bporter2387’s picture

Here's the updated code for Drupal 7. It turns you you need $mapid but it was stripped out in the README

$rows[] = array(
    array(
      'data' => '<div id="getdirections_map_canvas_' . $mapid . '" style="width: '. $width .'; height: '. $height .'" ></div>',
      'valign' => 'top',
      'align' => 'center',
      'class' => 'getdirections-map',
    ),
  );
  $rows[] = array(
    array(
      'data' => ($getdirections_defaults['use_advanced'] && $getdirections_defaults['advanced_alternate'] ? '<button id="getdirections-undo-' . $mapid . '" onclick="getdirectionsundo()">' . t('Undo') . '</button>' : '') .'<div id="getdirections_directions_' . $mapid . '"></div>',
      'valign' => 'top' ,
      'align' => 'left',
      'class' => 'getdirections-list',
    ),
  );
hutch’s picture

I will update the README for 7.x-3.x to reflect this, thank you for reporting this.

modiphier’s picture

Hello,

There is no such file getdirections.theme.inc in drupal 7 version?

hutch’s picture

The file getdirections.theme.inc was removed a while ago, the functions in it can be found in getdirections.module. I have updated the README.txt

vlooivlerke’s picture

How can I make the map and directions responsive. If it was not in a table but div's it would have been much easier to do. What I want to do is have the directions on the right on a desktop screen and on the bottom on a mobile screen.

hutch’s picture

Follow the instructions in #1 and edit the code so that the lines in 'data' are wrapped in divs instead of being themed as a table, give the divs unique ids or classes and control them with css so that they lie side-by-side on wide screens but above and below on narrow ones. You should be able to do this with something like this

  $output .= '<!-- getdirections in div -->';
  $output .= '<div class="getdirections">';
  $output .= '<div class="getdirections-map"  style="width: ' . $width . '; height: ' . $height . '" >';
  $output .= '<div id="getdirections_map_canvas_' . $mapid . '" style="width: 100%; height: 100%" ></div>';
  $output .= '</div>';
  $output .= '<div class="getdirections-list">';
  if ($getdirections_defaults['use_advanced'] && $getdirections_defaults['advanced_alternate']) {
    $output .= '<button id="getdirections-undo-' . $mapid . '">' . t('Undo') . '</button>';
  }
  $output .= '<div id="getdirections_directions_' . $mapid . '"></div>';
  $output .= '</div>';
  $output .= '</div>';
  $output .= '<!-- /getdirections in div -->';

This example is from getdirections-7.x-3.x, edit to suit whatever version you are using.

vlooivlerke’s picture

Awesome, thanks allot. @hutch