post_get_listing_detailpage_query
Filter the listing data before sending it to the templates.
You need to have a working knowledge of Hooks before you get started.
Parameters
Name | Type | Description |
---|---|---|
$listing |
parameter |
(array) |
$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('post_get_listing_detailpage_query', function($listing, $params)
{
// Uncomment line below to view available data passed into hook
// fwd_dd($listing, $params);
return $listing;
});
Examples
Remove Links from Listing Text
Removes any hyperlinks added to the listing summary and description, leaving only the anchor text.
Clickfwd\Hook\Filter::add('post_get_listing_detailpage_query', function($listing, $params)
{
$listing['Listing']['text'] = preg_replace('#<a.*?>(.*?)</a>#i', '\1', $listing['Listing']['text']);
return $listing;
}, 10);
Source Files
/controllers/com_content_controller.php
/controllers/listings_controller.php
/jreviews/controllers/listings_favorites_controller.php