• Resolved arkstudio

    (@arkstudio)


    Hi I’m using a custom post type plugin and have extra meta boxes I’d like to display in the balloon.

    I’ve got the filter working as follows but the extra content isn’t showing:

    function custom_mashup_item($content) {
    	return '<div style="font-size:24px"> Location: ' . get_post_meta($post->ID, 'ecpt_location', true) . $content . '</div>';
    }
    
    add_filter('pronamic_google_maps_mashup_item', 'custom_mashup_item');

    The usual code for including in a template is:
    get_post_meta($post->ID, 'ecpt_location', true)

    Can you advise please?

    http://ww.wp.xz.cn/extend/plugins/pronamic-google-maps/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter arkstudio

    (@arkstudio)

    OK I have it working in part – the mashup I now have custom meta displaying in using the following function:

    function prefix_pgmm_item($itemContent) {
    	$itemContent = '';
    	$itemContent .= '<a href="'. get_permalink() .'">';
    	$itemContent .= 	get_the_title();
    	$itemContent .= '</a>';
    	$itemContent .= '<br />';
    	$itemContent .= get_post_meta(get_the_id(), 'ecpt_location', true);
    	// $itemContent .= get_the_tag_list('Tags: ',', ','');
    	$itemContent .= get_the_term_list(get_the_ID(), 'post_tag', 'Features: ', ', ', '', '');
    
    	return $itemContent;
    }
    
    add_filter('pronamic_google_maps_mashup_item', 'prefix_pgmm_item');

    However, on the single pages I’d like to not have this additional information in the balloon, infact, there can be no content at all if possible – how can this be achieved please?

    Thread Starter arkstudio

    (@arkstudio)

    OK actually I do need to change the content for the single page balloons – not just to remove the content – is there a way to distingish between a mash up and single map with the filter?

    Plugin Author Remco Tolsma

    (@remcotolsma)

    The ‘pronamic_google_maps_mashup_item’ filter is only used for Pronamic Google Maps mashups. There is currently no filter available for a single post Google Maps.

    Plugin Author Remco Tolsma

    (@remcotolsma)

    In the next release you can adjust the description in the balloon of an single post Google Maps with the following filter:

    function prefix_pgm_item_description($description) {
    	$description .= '<a href="#">Route</a>';
    
    	return $description;
    }
    
    add_filter('pronamic_google_maps_item_description', 'prefix_pgm_item_description');
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Pronamic Google Maps] Adding custom Meta data to balloon’ is closed to new replies.