JReviews logo Docs
Menu
Version

listing_list_action_buttons

Allows adding and removing buttons.

Filter
Listings List

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

Parameters

Name Type Description
$buttons parameter (array) action buttons
$params parameter (array) associative array with contextual data

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
    // 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 Files

  • /views/helpers/listing_helper.php