Follow us on Twitter

When configuring the F2C KML feed of the Joomla articles it is possible to either template the placemark description or the entire placemark.

Placemark description

The description of a placemark is the information withing the 'popup' in Google Maps. This is also called the InfoWindow.

Placemark templating

A Google Maps placemark has more attributes than the description. In the F2C KML extension it is possible to 'template' the entire placemark. To see all the placemark attributes we refer to the KML documentation from Google.

Getting started

1) Make sure all Form2Contnet components are upgraded to latest versions
2) Best to use Smarty for templating in KML
3) You have a F2C Content Type with either the Geo coder field OR two fields for latitude/longitude
3) 2 options in KML, let F2C generate feed items or custom templating for feed items

Option 1 - Description template


1) Select the appropriate fields
2) If you use our geo_coder field select it twice for lat/lon (F2C knows how to handle it)

 

Option 2 - Placemark template

Advance use! You should know more about the KML feed structure for this option.

1) Select the appropriate fields
2) Set to use templating and select template in Template based tab
3) Example of template below

EXAMPLE PLACEMARK TEMPLATE

Save the code as a template file (.tpl) and place it in <root>/media/com_form2content/templates

  ***** ALso note variable use according to the Template parameters and personal F2C field names***********

<Placemark id="{$F2C_ID}">
<name><![CDATA[{$JOOMLA_TITLE}]]> </name>
<visibility>1</visibility>
<Snippet maxLines="2" ><![CDATA[{$JOOMLA_TITLE}-{$JOOMLA_SECTION_TITLE}-{$JOOMLA_CATEGORY_TITLE}]]></Snippet>
<description><![CDATA[ 
<div style="width:300px; height:110px; text-align:left;">
{if $INTRO_FOTO}
<a href=<a href="http://www.dolcevia.com%7b$joomla_article_link%7d/" class="moz-txt-link-rfc2396E">"http://www.dolcevia.com{$JOOMLA_ARTICLE_LINK}"</a>style="width:80px; height:80px; display:block; overflow:hidden; border:1px solid #ccc;  margin: 0 5px 5px 0; float:left;" target="_parent" ><img src="http://www.form2content.com/{$INTRO_FOTO_THUMB_URL_ABSOLUTE}" alt="{$JOOMLA_TITLE}" /><a></a>
{/if}
<p style="text-align:left;">
{$INTRO|truncate:100}<a href="/{$JOOMLA_ARTICLE_LINK}" target="_parent">reda more</a
</p>
<div style="clear:both;"></div>
</div>
]]> 
</description>
<styleUrl>#pin</styleUrl>
<Point>
<coordinates>{$GEOCODE_LON},{$GEOCODE_LAT}</coordinates>
</Point>
</Placemark>



To finish CHECK if the KML feeds renders without problems!!

LIVE Example

Dolcevia.com is a Dutch eMagazine about Italy. One of the directories it includes is for Agriturismo. The different accommodations are added using Form2Content Pro, incl. the geo_coder field type for the address.

Website url: http://www.dolcevia.com/nl/italie-reizen/agriturismo
KML feed: http://www.dolcevia.com/nl/index.php?option=com_form2contentkmlfeeds&task=view&format=raw&id=3

To render the KML feed I have used the Google Map plugin from Mike Reumer.

{mosmap kml='<a href="http://www.dolcevia.com/nl/index.php?option=com_form2contentkmlfeeds&task=view&format=raw&id=3" class="moz-txt-link-freetext">http://www.dolcevia.com/nl/index.php?option=com_form2contentkmlfeeds&task=view&format=raw&id=3</a>'|height='600'|centerlat='41.87194'|centerlon='12.56738'|zoom='6'}

Many more options with this plugin are available and are documentated on Mike's website.

F2C-Logo
FacebookTwitterDiggGoogle BookmarksLinkedInRSS Feed

F2C updates only!

:

F2C Forum Last Topics

Form2Content Wishlist

The community F2C wishlist on uservoice lets you add and vote on ideas. Let us know what you would like!

Follow us on facebook
Follow us on Twitter
Follow us on Linkedin