• Resolved e222w

    (@e222w)


    Hello, thank you for the great plugin. I have the following question: Is there a way to display additional content (HTML block) before/after the map? Maybe with a hook? Thank you for a feedback…

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Chandni Patel

    (@phpwebdev)

    Hello @e222w,

    Thank you for appreciating the plugin.
    You can add html content before of after the content using the map position from the map settings.

    You can also pick custom position, and display the map using shortcode / gutenberg block

    Hope this documentation helps
    https://wp-mapit.chandnipatel.in/documentation/displaying-map-on-the-page/

    Thread Starter e222w

    (@e222w)

    Thank you for the quick feedback; Yes, I am aware of the possibilities, integrating the map is not the problem, it works wonderfully. I would like to display the map on several pages (>50) and also include (before/after) a text with a description of the map (HTML code).

    Plugin Author Chandni Patel

    (@phpwebdev)

    You can use the shortcode / gutenberg blocks for it, you can also create a multipin map and use shortcode to display the map on the page.

    If you can show the example of what you propose to do, I can provide you with a better direction.

    Thread Starter e222w

    (@e222w)

    Okay, thank you very much… an example to describe my problem better: A map is displayed on over 50 different pages (this works wonderfully with the shortcode). In addition, a text (HTML code) should now be displayed before/after the map on all maps. I can also put this text on every single page, but if the text should be changed, I have to change the text on all 50 pages. On the other hand, if the text was inserted with a hook before/after the map, only one change is necessary… do you know what I mean?

    Plugin Author Chandni Patel

    (@phpwebdev)

    Thank you for explaining, I am sorry currently this is not possible with the plugin. I think you will have to write a custom shortcode for it

    Thread Starter e222w

    (@e222w)

    okay, thank you very much… then I’ll try to program something of my own…

    • This reply was modified 2 years ago by e222w.
    Plugin Author Chandni Patel

    (@phpwebdev)

    Sure, do let me know if you need any other help.

    Thread Starter e222w

    (@e222w)

    This works!

    function lb_append_map_description($output, $tag) {
    	if ( 'wp_mapit_map' !== $tag ) {
    		return $output;
    	}
    	return $output . '<div>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</div>';
    }
    add_filter('do_shortcode_tag', 'lb_append_map_description', 10, 2);
    Plugin Author Chandni Patel

    (@phpwebdev)

    Thats wonderful.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Additional Content (HTML block) before/after map?’ is closed to new replies.