Hi when I try to open a colorbox with a few other panels and a location map it says javascript required..

Is it just possible to open the map in a separate box?

Comments

hutch’s picture

I don't know why you are seeing this error message, but Colorbox opens in an Iframe and you can control this in your theme with function template_preprocess_getdirections_box() and the template file getdirections_box.tpl.php.

Stellanhaglund’s picture

Doesnt it open in a div?

Yorgg’s picture

@Stellanhaglung: Did you manage to get it loading?
I've copied the .tpl.php file to my theme templates folder but I'm not sure how to add class="colorbox-load" into the link at getdirections_field.
I've also enabled this and the inline features in colorbox module.

hutch’s picture

@staminna, if you are using Getdirections 7.x-3.x-dev and want to alter the Field that provides a link to a getdirections map, you can copy function theme_getdirections_fields_link() from getdirections_fields.module to your theme's template.php, renaming it of course and altering it there.
Just tested this:

Change

  $link = t('Get directions !t !l', array('!t' => $direction_text, '!l' => l($link_text, $path)));

to

  $path = 'getdirections_box/' . $entity_type . '/' . $direction . '/' . $entity_id;
  $opts =array(
    'attributes' =>
      array('class' => array('colorbox-load')),
    'query' => array(
      'iframe' => 'true',
      'width' => '700',
      'height' => '600',
    ),
  );
  $link = t('Get directions !t !l', array('!t' => $direction_text, '!l' => l($link_text, $path, $opts)));

Remember to flush cache after editing template.php

See

https://api.drupal.org/api/drupal/includes!common.inc/function/l/7

for details on what you can do with function l()

hutch’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev

There is a bug in the method described in #4, I will be working on a fix.

Update: getdirections_box has been fixed, the method shown in #4 will work, you will need to fetch the latest dev when it appears, hopefully tomorrow, or pull it with git.
Just to be clear, this applies to Getdirections 7.x-3.x-dev

Yorgg’s picture

Thanks Hutch, it worked.