listing_list_action_buttons

Filter Hook Listings List

Allows adding and removing buttons.

Parameters

$buttons

(array) action buttons

$params

(array) associative array with contextual data

You need to have a working knowledge of Hooks before you get started.

Boilerplate Code

Use the boilerplate code to start using the filter, and add your own logic to modify the first argument and return it.

Clickfwd\Hook\Filter::add('listing_list_action_buttons', function($buttons, $params) 
{
  // Uncomment line below to view available data passed into hook
  // For JReviews 3.x and earlier use dd instead of fwd_dd
  // fwd_dd($buttons, $params);
  
  return $buttons;
});
Development & Support
Customizations are not included with support. We provide this information to make it easier for developers to extend the functionality. From time to time we may have some availability for custom work. Get in touch to see if there's an opportunity to work together.

Examples

Add Favorite Button to Listing List Pages

The button will only show in list layouts that offer support for displaying buttons.

Clickfwd\Hook\Filter::add('listing_list_action_buttons', function($buttons, $params)
{
  $listing = $params['listing'];

  $listingHelper = ClassRegistry::getClass('ListingHelperHelper');

  ob_start();

  $listingHelper->favorite($listing);

  $favoriteButton = ob_get_clean();

  $buttons['favorite'] = $favoriteButton;

  return $buttons;
}, 10);

Add Send Inquiry Button to Listing List Pages

The button will only show in list layouts that offer support for displaying buttons.

Clickfwd\Hook\Filter::add('listing_list_action_buttons', function($buttons, $params)
{
  $listing = $params['listing'];

  $listingHelper = ClassRegistry::getClass('ListingHelperHelper');

  ob_start();

  $listingHelper->inquiry($listing);

  $contactButton = ob_get_clean();

  $buttons['inquiry'] = $contactButton;

  return $buttons;
}, 10);

Source

  • /views/helpers/listing_helper.php