Skip to content

Instantly share code, notes, and snippets.

@rali14
Created November 1, 2016 16:18
Show Gist options
  • Save rali14/808563acef395732986f61a2830b4ff5 to your computer and use it in GitHub Desktop.
Save rali14/808563acef395732986f61a2830b4ff5 to your computer and use it in GitHub Desktop.
Jobify Map Bubble Template
<script id="tmpl-infoBubble" type="text/template">
<a href="{{{ data.link }}}">
<# if ( typeof( data.thumb ) != 'undefined') { #>
<span style="background-image: url({{{ data.thumb }}})" class="list-cover has-image"></span>
<# } #>
<# if ( typeof( data.title ) != 'undefined') { #>
<h1>{{{ data.title }}}</h1>
<# } #>
<# if ( typeof( data.rating ) != 'undefined') { #>
<span class="rating stars-{{{ data.rating }}}">
{{{ data.rating }}}
</span>
<# } #>
<# if ( typeof( data.address ) != 'undefined') { #>
<span class="address">{{{ data.address }}}</span>
<# } #>
<# if ( typeof( data.date_added ) != 'undefined') { #>
<span class="date">{{{ data.date_added }}}</span>
<# } #>
</a>
</script>
@Sandfuss
Copy link

Sandfuss commented May 5, 2017

Hi rali14

Thanks a lot for those examples.

Would you know how to figure out what code to use if I want to show following in the pop-up:

  • Category (could be a hotel, privat room etc)
  • Price (price of the specific listing)

I have tried changing the word "address" with the word "category" and "listing_category" in your code above, but al it does is to remove the address from the pop-up.

I can't figure out what to type in the "typeof", the "span class" and the data.xxx

Thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment