Hello, I am trying to change the map marker to a different icon if my node was recently updated. Currently I am using:

$style = array();
if ($record->node_type == 'business') {
  $style['externalGraphic'] = base_path().'images/map_blue.png';
} else {
  $style['externalGraphic'] = base_path().'images/map_blue.png';
}
$style['graphicHeight'] = 24;
$style['graphicWidth'] = 24;
$style['graphicOpacity'] = 1;
$style['graphicYOffset'] = -22;
return $style;

This is only a sample piece of code that I found and modified to always use the same icon. How might I modifiy this code to change to another image if the node was updated within a week?

Comments

j0k3z’s picture

Or, show another static image based on a check box on the node being checked.

phayes’s picture

If you click "preview", underneath the query, you'll see find and replace patterns that you can drop into the styles

j0k3z’s picture

Hmm, for some reason I dont see that on my screen:

http://i.imgur.com/pV7Ut.png

zzolo’s picture

Status: Active » Closed (works as designed)

@j0k3z, on the 6.x version, I asume you are using a theme function to get to that code. You need to put the node created date into your view and it will be accessible in the View.

For the D7 approach (what Patrick is referring to there) is that you should use style replacements.

Closing, but feel free to re-open if needed.