By Konrad Skalla on Wednesday, 28 November 2018
Posted in General
Likes 0
Views 814
Votes 0
Hi guys,

I would like to add new button to the listing page of Jreviews component. Thats why i wrote a message to jreviews support to ask is that even possible... thats what i get back :

" Hi

You can find the solution here :
[gist type="php"]
https://docs.jreviews.com/?title=JReviews:Developers_Filters#Listing_Detail_Action_Buttons
[/gist]

Read from the beginning of the article so you create the necessary filter file with the opening <?php tag. "

There is example for easysocial to add message button :

Examples
Add EasySocial Message Button

function add_easysocial_message_button($buttons, $params)
{
if ( !defined('ES_MESSAGE_FILTER') )
{
require_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php');

ES::initialize();

ES::language()->loadSite();

define('ES_MESSAGE_FILTER', 1);
}

$listing = $params['listing'];

$easysocial = '
<button type="button" class="jrButton jrSmall"
data-es-conversations-compose=""
data-id="'.$listing['User']['user_id'].'"
data-es-provide="tooltip"
data-original-title="Contact This Member"
>
<span class="jrIconMessage"></span> Contact This Member
</button>
';

$buttons[] = $easysocial;

return $buttons;
}

Clickfwd\Hook\Filter::add('listing_detail_action_buttons', 'add_easysocial_message_button', 10);


Im not so good in php stuff... i really need that solution guys :-) can you please help me with that, i have no idea where to add this code, in which file. Maybe you can just explain me or maybe you can just add this code please
If you ask how to add Easysocial conversation message button on specific Easysocial page, then we can able to assist you because Easysocial component developed by us but now you would like to display this message button on jReview listing page, so the best is consult with them and see which PHP file render that listing page then you can able to add those suggestion code into that PHP file.
·
Wednesday, 28 November 2018 18:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Im not so good in php stuff... i really need that solution guys :-) can you please help me with that, i have no idea where to add this code, in which file. Maybe you can just explain me or maybe you can just add this code please


re-read the instructions from jreviews, it has nothing to do with coding:

you have to place a override for the filter_functions.php:

/templates/jreviews_overrides/filters/filter_functions.php

in this file you can place your filter afterwards...
·
Wednesday, 28 November 2018 18:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing
·
Wednesday, 28 November 2018 19:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Im not so good in php stuff... i really need that solution guys :-) can you please help me with that, i have no idea where to add this code, in which file. Maybe you can just explain me or maybe you can just add this code please


re-read the instructions from jreviews, it has nothing to do with coding:

you have to place a override for the filter_functions.php:

/templates/jreviews_overrides/filters/filter_functions.php

in this file you can place your filter afterwards...


Thank you n00bster! I thought it will be more complicated
·
Wednesday, 28 November 2018 19:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Glad to hear that your issue has been resolved now.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Wednesday, 28 November 2018 22:45
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post