Jump to content

Conditionally linking to listing in map infowindows based on custom field


Matthew Bayliss

Recommended Posts

I've not really done many modifications to the map infowindow's, so have a couple of q's about customising them - specifically tinkering with the listing title and link.

 

On a new site we're working on we sometimes don't want the infowindow to link to the listing (for example, when the listing has very little information and only exists for mapping purposes of trivial things).

 

To do this elsewhere on the site (eg: listing pages and modules) we have a custom checkbox field that, if checked, causes the theme files to output only the listing name and not the link:

 

<?php if (in_array('hide-listing-link', $CustomFields->fieldValue('jr_listingadmin',$listing))): ?>
<?php echo $listing['Listing']['title'];?>
<?php else:?>
<?php echo $Html->sefLink($listing['Listing']['title'],$listing['Listing']['url']);?>
<?php endif;?>

 

However, I'm not sure how to apply this same principle to the infowindow code as it seems to be processed differently:

 

<a class="jr-map-title" href="#"></a>

 

Any suggestions on how to implement something like this on the infowindow?

Link to comment
×
×
  • Create New...