Using mosmap on your Joomla Contact page

Want to integrate the mos_map plugin to appear on your Contact Us page? here’s how

First, install and configure the mosmap plugin.

Second : create a new article with the { mosmap } (remove spaces) plugin call.

Third: Grab the link to the new article

Figure out that the link to the page is … I like JCE because the hyperlink button will let you navigate your content, and shows you the links 🙂

Mine was :  index.php?option=com_content&view=article&id=82

Another option is to create a menu that is not published, and create a new menu item on it.  I used to create a menu entitled “hidden” on all my Joomla site, but find that is only necessary if using breadcrumbs.

Forth: Set up your template over rides

Using the J1.5 template overrides, under your template directory, if there isn’t already a html directory, create one.

Then create com_contact/contact/

copy all the files you find in components/com_contact/views/contact/tmpl/ over to templates/yourtemplate/html/com_contact/contact/

default_address.php
default_form.php
default.php
default.xml
index.html

Fifth:  Modify the default files to include the map

In this new directory, create a new file : call it default_map.php.  In this file, you want to put the following code:

<iframe src=”__MAP_LINK__&tmpl=component” style=”border:0px;overflow:hidden;width:850px;height:450px;”></iframe>

You may need to fine tune the style to match up with your mosmap settings (width, height).

tmpl=component tells joomla to just render the page without any headers, menus, etc

save off this file.

Now open default.php and you want to place the following depending on where you want your map.  I want my map to show across the top, so I put mine right after the opening <div>:

 

This will load the default_map.php file you just created.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *