After successful installation of K2 Google Maps plugin there are extra fields in Plugins Tab in item edit form:
This text is a step by step manual how to get special Map Tab in item edit form:
administrator/components/com_k2/views/item/view.html.php
Find rows around #293
$K2PluginsItemOther=$dispatcher->trigger('onRenderAdminForm', array (&$item, 'item', 'other' ) ); $this->assignRef('K2PluginsItemOther', $K2PluginsItemOther); $form = new JParameter('', JPATH_COMPONENT.DS.'models'.DS.'item.xml'); $form->loadINI($item->params); $this->assignRef('form', $form);
.. and add 2 lines, so the final code is
$K2PluginsItemOther=$dispatcher->trigger('onRenderAdminForm', array (&$item, 'item', 'other' ) ); $this->assignRef('K2PluginsItemOther', $K2PluginsItemOther); $K2PluginsItemGMap=$dispatcher->trigger('onRenderAdminForm', array (&$item, 'item', 'gmap' ) ); $this->assignRef('K2PluginsItemGMap', $K2PluginsItemGMap); $form = new JParameter('', JPATH_COMPONENT.DS.'models'.DS.'item.xml'); $form->loadINI($item->params); $this->assignRef('form', $form);
administrator/components/com_k2/views/item/tmpl/default.php
Find lines #247-259
<!-- Tabs start here --> <div class="simpleTabs"> <ul class="simpleTabsNavigation"> <li id="tabContent"><a href="#"><?php echo JText::_('Content'); ?></a></li> <li id="tabImage"><a href="#"><?php echo JText::_('Image'); ?></a></li> <li id="tabImageGallery"><a href="#"><?php echo JText::_('Image gallery'); ?></a></li> <li id="tabVideo"><a href="#"><?php echo JText::_('Video'); ?></a></li> <li id="tabExtraFields"><a href="#"><?php echo JText::_('Extra fields'); ?></a></li> <li id="tabAttachments"><a href="#"><?php echo JText::_('Attachments'); ?></a></li> <?php if(count(array_filter($this->K2PluginsItemOther))): ?> <li id="tabPlugins"><a href="#"><?php echo JText::_('Plugins'); ?></a></li> <?php endif; ?> </ul>
.. and add 1 line, so the final code is
<!-- Tabs start here --> <div class="simpleTabs"> <ul class="simpleTabsNavigation"> <li id="tabContent"><a href="#"><?php echo JText::_('Content'); ?></a></li> <li id="tabImage"><a href="#"><?php echo JText::_('Image'); ?></a></li> <li id="tabImageGallery"><a href="#"><?php echo JText::_('Image gallery'); ?></a></li> <li id="tabVideo"><a href="#"><?php echo JText::_('Video'); ?></a></li> <li id="tabExtraFields"><a href="#"><?php echo JText::_('Extra fields'); ?></a></li> <li id="tabAttachments"><a href="#"><?php echo JText::_('Attachments'); ?></a></li> <li id="tabGMap"><a href="#"><?php echo JText::_('Map'); ?></a></li> <?php if(count(array_filter($this->K2PluginsItemOther))): ?> <li id="tabPlugins"><a href="#"><?php echo JText::_('Plugins'); ?></a></li> <?php endif; ?> </ul>
then, in the same file find lines #593-594
<?php if(count(array_filter($this->K2PluginsItemOther))): ?> <!-- Tab other plugins -->
.. and before these add few lines, so the final code is
<!-- Tab gMap -->
<div class="simpleTabsContent">
<div class="itemPlugins">
<?php foreach ($this->K2PluginsItemGMap as $K2Plugin) : ?>
<?php if(!is_null($K2Plugin)): ?>
<fieldset>
<legend><?php echo $K2Plugin->name; ?></legend>
<?php echo $K2Plugin->fields; ?>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<?php if(count(array_filter($this->K2PluginsItemOther))): ?>
<!-- Tab other plugins -->
administrator/components/com_k2/css/k2.css
Add style to css file, line #235
ul.simpleTabsNavigation li#tabGMap a {background-image: url('/../images/editforms/Map.png');}
and upload an icon for the tab
administrator/components/com_k2/images/editforms/Map.png
In very similiar way you can modify files for category edit form:
Download all modified files in following ZIP package, extract with complete directory structure and after back-up of original files, upload to your server.
K2 version 2.3!, also changed files with special Tab in category edit form included.
The Basilica of the Sacred Heart of Jesus of Paris, commonly known as Sacré-Cœur Basilica, is a Roman Catholic church and minor basilica, dedicated to the Sacred Heart of Jesus, in Paris, France. A popular landmark, the basilica is located at the summit of the butte Montmartre, the highest point in the city.
The Eiffel Tower is an 1889 iron lattice tower located on the Champ de Mars in Paris that has become both a global icon of France and one of the most recognizable structures in the world. The Eiffel Tower, which is the tallest building in Paris, is the single most visited paid monument in the world; millions of people ascend it every year. Named after its designer, engineer Gustave Eiffel, the tower was built as the entrance arch for the 1889 World's Fair.
The Brooklyn Bridge is one of the oldest suspension bridges in the United States. Completed in 1883, it connects the New York City boroughs of Manhattan and Brooklyn by spanning the East River. With a main span of 1,595.5 feet (486.3 m), it was the longest suspension bridge in the world from its opening until 1903, and the first steel-wire suspension bridge.
The Empire State Building is a 102-story landmark Art Deco skyscraper in New York City at the intersection of Fifth Avenue and West 34th Street. Its name is derived from the nickname for the state of New York, The Empire State. It stood as the world's tallest building for more than forty years, from its completion in 1931 until construction of the World Trade Center's North Tower was completed in 1972. Following the destruction of the World Trade Center in 2001, the Empire State Building once again became the tallest building in New York City and New York State.
Version: 1.0
The plugin adds some additional fields in K2 backend for item, category and user.
In K2 frontend it display Google Map with selected marker on position of respective item, etc.
Appearence of the Google Map highly customizable by plugin parameters.
Zoom/Pan Controls = None
Google Maps Type Buttons = No
Map Type on Start = Normal
Show Overview Map = No
Zoom/Pan Controls = Small Maps Control
Google Maps Type Buttons = No
Map Type on Start = Satellite
Show Overview Map = Yes
Zoom/Pan Controls = Large Maps Control
Google Maps Type Buttons = Yes
Map Type on Start = Terrain
Show Overview Map = No
Do you like my plugin?
Did I save your time and effort?
Please donate for further work.