Customizing search result of 'Search - Flexiadvsearch, FLEXIcontent search view' plugin

More
6 years 11 months ago #71257 by Ali_wdm
Hello ggppdk,

I want to add some condition for searching in 'Search - Flexiadvsearch, FLEXIcontent search view' plugin. There is some flexi field created by me, I want to use their 'getFiltered()' method in searching.

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #71259 by ggppdk


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago - 6 years 11 months ago #71260 by Ali_wdm
I am using third party module 'Universal AJAX Live Search'. It searches the items using ajax call.

There is code in plugins\search\flexiadvsearch.php on line 627

$filtervalue = JRequest::getVar('filter_'.$field->id, '');
$empty_filtervalue_array = is_array($filtervalue) && !strlen(trim(implode('',$filtervalue)));
$empty_filtervalue_string = !is_array($filtervalue) && !strlen(trim($filtervalue));
if ($empty_filtervalue_array || $empty_filtervalue_string) continue;

There is no filter value in URL, so it does not call getFilteredSearch() function of the flexi custom field.
If I comment this line

if ($empty_filtervalue_array || $empty_filtervalue_string) continue;

It call the getFilteredSearch() function, and everything is working fine.
Please tell me how I call getFilteredSearch() function with no value in URL.


Note: There is one parameter 'allow_filtering_empty' to call getFiltered() function without any filter value in URL. I think, if there is one parameter like 'allow_filtering_empty', then this problem is sorted out. Please suggest me.
Last edit: 6 years 11 months ago by Ali_wdm.

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #71264 by Ali_wdm

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #71266 by ggppdk
Hello

you can try creating a system plugin and setting your value in an early event
Code:
// no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('cms.plugin.plugin'); if (!defined('DS')) define('DS',DIRECTORY_SEPARATOR); require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_flexicontent'.DS.'defineconstants.php'); /** * Example system plugin */ class plgSystemFlexisystem extends JPlugin { /** * Constructor */ function __construct( &$subject, $config ) { parent::__construct( $subject, $config ); } function onAfterInitialise() { if (JFactory::getApplication()->isAdmin()) $this->handleSerialized(); $app = JFactory::getApplication(); $task = $app->input->get('task', '', 'string'); // NOTE during this event 'task' is (controller.task), thus we use filtering 'string' $view = $app->input->get('view', '', 'string'); $option = $app->input->get('option', '', 'string'); $some_value = $app->input->get('some_name', '', 'string'); if ( $view == 'search' ) { if ( $comp == 'com_content' || $comp == 'com_flexicontent' ) { $app->input->set('filter_' . 14, $some_value); //JRequest::setVar('filter_' . 14, $some_value); } } } }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #71268 by Ali_wdm
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.835 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline