JReviews logo Docs
Menu
Version

jreviews:listing:actions

Allows adding, removing, and reordering action buttons on listing detail and list pages.

Filter
listing-detail

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

Available action keys: manage, write_comment, compare, upload, favorite, claim, inquire.

Use the generic hook to apply to all contexts, or a context-specific variant:

  • jreviews:listing:actions.detail — listing detail page
  • jreviews:listing:actions.detail_comments — listing detail comments section
  • jreviews:listing:actions.listings_list — category and search list pages
  • jreviews:listing:actions.list — list layout
  • jreviews:listing:actions.card — card layout

Parameters

Name Type Description
$filterResult parameter (array) keys: blocks (Collection), include (array|null), exclude (array), context (string), size (string), variant (string)
$listing parameter (Listing) the listing model

Boilerplate Code

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

fwd_add_filter('jreviews:listing:actions', function($filterResult, $listing)
{
    // Your code here
    
    return $filterResult;
});
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

Hide write review button for guests

Remove the write review button from the listing detail page for guest users. Use the context-specific variant to target the detail page only.

fwd_add_filter('jreviews:listing:actions.detail', function($filterResult, $listing)
{
    if (fwd_auth()->user()->isGuest()) {
        $filterResult['exclude'][] = 'write_comment';
    }

    return $filterResult;
}, 10, 2);

Show the send inquiry button only for featured listings.

fwd_add_filter('jreviews:listing:actions', function($filterResult, $listing)
{
    if (! $listing->featured) {
        $filterResult['exclude'][] = 'inquire';
    }

    return $filterResult;
}, 10, 2);

Source Files

  • /resources/views/site/components/listing/actions.blade.php