-1

I'm doing some web scraping with Python and the last step is to use Google Fusion maps, but as somebody who has never touched any CSS styling before, I have no idea how to do something probably incredibly simple: hide a column title in the info window if it's blank. Not all the data have entries in my Amenities column, so I would like that to be gone from the info window if it's blank.

I've read this (https://support.google.com/fusiontables/answer/3081246?hl=en&ref_topic=2575652), but it's complete gibberish to me at this stage.

This is the default HTML they provide for the info window (with my data):

<div class='googft-info-window'>
<b>Location:</b> {Location}<br>
<b>Movie Title:</b> {Movie Title}<br>
<b>Date:</b> {Date}<br>
<b>Amenities:</b> {Amenities}
</div>

This shot in the dark didn't work:

<div class='googft-info-window'>
<b>Location:</b> {Location}<br>
<b>Movie Title:</b> {Movie Title}<br>
<b>Date:</b> {Date}<br>
<b>{if Amenities.value}
  Amenities:
  {/if}Amenities:</b> {Amenities}<br>
</div>
halfer
  • 19,824
  • 17
  • 99
  • 186
SpicyClubSauce
  • 4,076
  • 13
  • 37
  • 62

1 Answers1

0

This question isn't related to CSS, try this:

{template .contents}
<div class='googft-info-window'>
<b>Location:</b> {$data.value.Location}<br/>
<b>Movie Title:</b> {$data.value['Movie Title']}<br/>
<b>Date:</b> {$data.value.Date}<br/>
{if $data.value.Amenities}
  <b>Amenities:</b>{$data.value.Amenities}<br/>
{/if}
</div>
{/template}
Dr.Molle
  • 116,463
  • 16
  • 195
  • 201