I just found the module and it looks great. Love the concept.
To bridge the gap between being limited to just the blocks, how about adding an option to include these into the content via filter tags. This would allow you to add the maps to almost anything! Here is the implementation that I used to do this on a project that I am working on:
<?php
/**
* Implementation of hook_filters().
*/
function isis_filter($op, $delta = 0, $format = -1, $text = '', $cache_id = 0) {
switch ($op) {
case 'list':
return array(
0 => t('Include a google map block.'),
);
case 'description':
switch($delta) {
case 0: return t('Include a google map block using the tag, [gmap-block:XXX]');
}
case 'prepare':
return $text;
case 'no cache':
switch ($delta) {
case 0:
return TRUE;
}
case "process":
switch($delta) {
case 0: return preg_replace_callback('/\[gmap\-block:([^\]]*)\]/', '_isis_gmap_block_replacer', $text);
}
}
}
function isis_filter_tips($delta, $format, $long = false) {
switch($delta) {
case 0: return t('[gmap-block:XXX] - insert the google map block that has the ID of XXX. For example, [gmap-block:1].');
}
}
function _isis_gmap_block_replacer($matches) {
if (is_numeric($matches[1])) {
module_load_include('content.inc', 'gmap_blocks');
if ($block = gmap_blocks_content($matches[1])) {
return $block['content'];
}
}
return '';
}
?>
Comments
Comment #1
alan d. commentedJust a sanity check for entering a wrong gmap-block id into the filter code:
We have used this filter on 4 sites to date. It is a really nice feature to enable users to embed gmap blocks on their "contact us" page.
Comment #2
skilip commentedThis definitely would be a cool feature. However, I'm not going to take this into the current release while it would delay the already too much delayed release of this module. Postponing this issue to the next release.
Comment #3
mstrelan commented@skilip - The code is already available, why not stick it in the module, at least as a dev version? I have used this on at least 5 sites and it works a treat. Additional features could include "left" and "right" in the token, and you could include css classes to float these.
Comment #4
alan d. commentedpinging.....
Comment #5
meichr commented+1 subscribing
Comment #6
alan d. commentedbumping as we start a multisite implementation with another hacked version of the module....
Comment #7
Ela commentedsubscribing
Comment #8
mstrelan commented