Linking to a different listingDetail.php pages

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 5, 2013   (RSS)

By gregThomas - May 27, 2013

Hi Andy, 

I would do something like this:

<?php if($listing['sale_or_rental_field'] == 'sales'): ?>
  <a href="<?php echo $listing['_link'] ?>" class="button style1">Click Here</a>
<?php else: ?>
  <a href="listingDetail_rentals.php?<?php echo urlencode($listing['address']).'-'.$listing['num']; ?>" class="button style1">Click Here</a>
<?php endif; ?>

This is just example code, so you might have to make a few changes to get it working. You'll need to change sale_or_rental_field to the field that stores if a property is rental or sales, and the value that would make it a sales type.

So if the record is a sales record, it will display the normal _link, but if it's a rental record type, then it will link to the listingDetail_rentals.php page with the num and first line of the address in the url.

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By andybarn - June 5, 2013

Thanks Greg

That was more than I needed.

I was already on the Rentals listing_rentals.php page so I did not need the "if" statement.

I just needed the link <a href="listingDetail_rentals.php?<?php echo $listing['num'] ?>" class="button style1">Click Here</a></span>

Thanks again though - you pointed me in the right direction and using the link above works great!

Andy