Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Form2Content/c6fd4ca5835d01a0280f to your computer and use it in GitHub Desktop.
Save Form2Content/c6fd4ca5835d01a0280f to your computer and use it in GitHub Desktop.
This is a Google Maps place marker Smarty template for use with Form2Content KML Feeds. It includes several explanations of the code. The results can be seen on http://demo.form2content.com/extensions/f2c-kml-feeds-demo
{* This is a SMARTY placemarker template for the Form2Content KML extension. It is an example which I have used for a project and shows how you can use the F2C fields (data) within a custom placemarker.*}
{*text between these tags won't be rendered into your placemarker*}
{if $GEOCODER_LAT}
<Placemark>
{*I use the _RAW template parameter to show HTML as is*}
<name>{$JOOMLA_TITLE_RAW}</name>
<description><![CDATA[
<div style="width:200px;" class="f2c_placemarker">
<p>{$DESCRIPTION|strip_tags:true|truncate:150}</p>
<p>{if $YEAR}Year of release: {$YEAR_TEXT}<br/>{/if}
Genre: {$JOOMLA_CATEGORY_TITLE}
{if $RATING}<br/>Rating: {$RATING}{/if}
</p>
<p><a href="{$JOOMLA_ARTICLE_LINK_SEF}" target="_parent" title="{$JOOMLA_TITLE_RAW}">... read more</a></p>
</div>
]]>
</description>
{*HERE I SPECIFY WHICH ICON URL SHOULD BE USED PER CATEGORY. NOTE: Do NOT have any spaces between the id and the tags! DON'T FORGET TO PLACE THE ICONS IN THE KML FEED HEAD.*}
{if $JOOMLA_CATEGORY_ID =='9'}
<styleUrl>#action</styleUrl>
{elseif $JOOMLA_CATEGORY_ID =='10'}
<styleUrl>#animation</styleUrl>
{elseif $JOOMLA_CATEGORY_ID =='11'}
<styleUrl>#comedy</styleUrl>
{elseif $JOOMLA_CATEGORY_ID =='12'}
<styleUrl>#docu</styleUrl>
{elseif $JOOMLA_CATEGORY_ID =='13'}
<styleUrl>#drama</styleUrl>
{elseif $JOOMLA_CATEGORY_ID =='14'}
<styleUrl>#horror</styleUrl>
{elseif $JOOMLA_CATEGORY_ID =='15'}
<styleUrl>#romance</styleUrl>
{elseif $JOOMLA_CATEGORY_ID =='16'}
<styleUrl>#western</styleUrl>
{elseif $JOOMLA_CATEGORY_ID =='17'}
<styleUrl>#scifi</styleUrl>
{/if}
{*Using the GeoCoder field type (which I named GEOCODER) you can render the lat and lon.*}
<Point>
<coordinates>{$GEOCODER_LON},{$GEOCODER_LAT}</coordinates>
</Point>
</Placemark>
{/if}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment