4
4
479112021-09-16 17:56:55
Joomla
47911, 2021-09-16 17:56:55

How to remove the link to the current page (Joomla smart search module)?

In general. Strange situation: I brought the smart search module to the site page. And I saw that when you go to other pages in the "search field" a link to the current page is displayed. How to remove it? (I looked into the module settings, searched on the Internet. But maybe I can’t formulate a search query normally to go to the page with the solution - help, please).

If anyone cares: Joomla 4.0.3
But I think that solutions from the "Joomla 3.X" series may be suitable, because they are quite close (as I looked at both the files and the admin panel).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
4
47911, 2021-09-18
@47911

Solution:
in /modules/mod_finder/tmpl/default.php
there is a line:

$input = '<input type="text" name="q" id="mod-finder-searchword' . $module->id . '" class="js-finder-search-query form-control" value="' . htmlspecialchars($app->input->get('q', '', 'string'), ENT_COMPAT, 'UTF-8') . '"' . ' placeholder="' . Text::_('MOD_FINDER_SEARCH_VALUE') . '">';

We change it to:
$input = '<input type="text" name="q" id="mod-finder-searchword' . $module->id . '" class="js-finder-search-query form-control" value="' . '"' . ' placeholder="' . Text::_('MOD_FINDER_SEARCH_VALUE') . '">';

Those. value = "" to get rid of the problem.

S
Sergei Tolkachev, 2021-09-17
@sergeytolkachyov

That is, you have incorrect links in the search results? For search, they usually make a hidden menu item with the type "search results". You can hide it so that it is not shown in the menu in the settings of the menu item. Try it, it might help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question