Articles Good Search - CLEAR button to remove search results?

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

#
Hi, when I search on selected criteria, the search results are posted just below. When I click the CLEAR button, the search criteria are removed, but the search results are not removed.

Is it somehow possible so that clearing the search can also remove the listed search results?
Thank you, Vicky

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

#
I understand if not possible, just wondering it it is possible. I am experimenting with the various display options.

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

#
Hello, Vicky.

Yes, it is possible with template override.

You need to modify this file - mod_articles_good_search\tmpl\Default\elements\clear_btn.php
Find this part:
<script type="text/javascript">
	function clearSearch_<?php echo $module->id; ?>() {
		$ = jQuery.noConflict();

Then append:
<?php
	$ajax_container = $params->get("ajax_container");
	if($ajax_container == "div.ajax_container") {
		$ajax_container = "#ajax_container{$module->id}";
	}
?>
$("<?php echo $ajax_container; ?>").html("");

This works only for Ajax search type (default).
For standard search results, you also need to append this line:

$("#your-main-content-area-id").html("");

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

#
Thank you!!