I've never found the functionality listed in the views' style settings that says: Remaining fields will be available in the "content" region of the point.

I've added this. Pretty simple - Added to the logic of the views_plugin_style_kml.inc

This way you can use theme_preprocess_kml_placemark($vars) to add variables to the templates for style and placemark.

Comments

jeffschuler’s picture

Version: 6.x-2.0-alpha1 » 6.x-2.x-dev
Status: Needs review » Needs work

Yeah, it looks like there's no functionality that actually backs that statement :p

Thanks for your patch!

We'll want some docs, too, instructing on how to get ahold of the stuff that gets thrown into $point['content'].

jeffschuler’s picture

Status: Needs work » Needs review
StatusFileSize
new1.76 KB

How about this?

Via preprocess, we make add those remaining fields into the $content variable.
Changed wording in KML style settings to make it this requires a custom kml-placemark.tpl.php.

jeffschuler’s picture

Title: Patch for: Remaining fields will be available in the "content" region of the point. » Make remaining fields available in point
jeffschuler’s picture

Assigned: lookatthosemoose » Unassigned
StatusFileSize
new3.21 KB

Better documentation of this functionality.

jeffschuler’s picture

Status: Needs review » Fixed

Committed #4 to 6.x-2.x. Thanks @lookatthemoose!

jeffschuler’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Fixed » Patch (to be ported)

This needs to be ported to 7.x.

tinem’s picture

I use 6.x-2.0-alpha1+9-dev and have this problem:

Why does my KML files sometimes open in browser instead of download file?

http://beta.findtoilet.dk/feeds/municipality

I have tried it in different browsers and it only happens sometimes and for different KML-files.
Think it would be best NOT to open in browser but ask for download just as CSV does.

A friend of mine that doesn't know drupal said:
"its a problem with the http header ContentType for some KML files. Somewhere in the PHP the content type is or should be set like this: header('Content-type: application/vnd.google-earth.kml+xml');"

Anyone know what code to change, please?

Edited 15 April 11:58: The strange thing is that the SAME browser and SAME file sometimes show text in browser but a little later it shows as to download and with filename. Could it be a cacheproblem when such things can happen?

jeffschuler’s picture

Hi tinem:

Please open a new support issue for your concern. It will make it easier for other folks to find, increase chances for getting a response, and won't confuse this issue, (which is about adding other field data to placemarks.)

jeffschuler’s picture

Issue summary: View changes

explained the filepath where the patch is applied.

pmusaraj’s picture

Issue summary: View changes
StatusFileSize
new1.53 KB

I made a patch for Drupal 7, attaching it here. Let me know if there are any issues with it.