Possible to show only title in ajax search ?

7 years 1 month ago #7900 by lusidjudjeto
I'd like to make some changes so in ajax search in search results to show only the title of the article without category and without article content. Is that possible?

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

7 years 2 weeks ago #7913 by Saka
Yes. It gets the layout from the regular search component so if you change it's layout in template overrides it will reflect on AJAX Search.

Emir Sakic
www.sakic.net

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

7 years 2 weeks ago #7919 by lusidjudjeto
Can you point which file exactly should I edit and in which directory?
I try in components/com_search/views/search/tmpl/default_results.php but nothing is changed

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

6 years 11 months ago #7927 by Saka
That's the file, you should not edit the core files so instead you should copy this file to templates/{yourtemplate}/html/com_search/search/default_results.php and edit there.

However, if you changed the core file and it doesn't have any effect then you may be using a custom template framework which has its own overrides. In that case you should consult your template provider to see where is the override for search component.

Emir Sakic
www.sakic.net

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

6 years 8 months ago #7943 by dcary
Is there a way to not search content, and only search article titles in specific category?

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

6 years 8 months ago - 6 years 8 months ago #7944 by Saka
So, the module does not have its own search, it uses whatever you use for search on your site. By default it's Joomla search component and it's Search - Content plugin. This plugin is coded so it searches the title AND the content, but it's easy to modify it and comment out the content part in the query (file plugins/search/content/content.php). Even better, you should create a duplicate of this plugin, install it and publish it instead so you don't modify the core file and so the next Joomla update does not overwrite your changes. There you could also add some code to restrict the search to certain categories. Either way, some coding is required.

Emir Sakic
www.sakic.net

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

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch