Maps in components, modules & contact Joomla 1.5.x PDF Print E-mail
Written by Mike Reumer   
Wednesday, 12 March 2008 01:00

You can make the plugin work in components, modules and contacts in Joomla 1.5!
A plugin works in articles, component com_content, but not in other components or modules.

You have to hack the index.php of Joomla 1.5.x in the root of your site. Your index.php file is probably (hopefully) locked-down, for security reasons.  So you may need to ask your hosting provider to temporarily adjust permissions, while you make the hack.

Add these lines at line 84 after $mainframe->render();:

JPluginHelper::importPlugin('content');
$tmp_row->text = JResponse::getBody();
$tmp_params = new JParameter(null);
$mainframe->triggerEvent('onMap', array( &$tmp_row, &$tmp_params ), true );
JResponse::setBody($tmp_row->text);

Now it will show the map if it's placed in components, modules and the contact form of Joomla!
 
It's not recommended to hack Joomla and it's for your own risk.
 
For contacts: Make a contact and in the field  Miscellaneous Information place the code for {mosmap}. Make sure the contact is reachable on the site.
 
For module: Goto module manager, create a new module, select custom HTML,  Place {mosmap} in Custom output. Now this module should show a map.
My example has the following code:
{mosmap width='150px'|height='150px'|showMaptype='0'|Overview='0'|zoomType='None'|lightbox='1'|effect='vertical'}
 
For modules you also can use module CustomContent.
Last Updated on Monday, 24 August 2009 18:39
 

Advertisement