Creating a search plugin
The com_search
component is the legacy search component in the Joomla! core that is still widely used, but will eventually be phased out and replaced with com_finder
(smart search). When you add a search module to your site, by default, it will only search the core Joomla! content, but in many cases it is useful to have component data also included in the search results. We can do this by creating a search plugin for our component.
Before we create our search plugin, we need to create a route file for our component that will be used by our plugins to create a link to an individual folio item. We can copy the route file from com_weblinks
and just make some minor changes, as our com_folio
component uses very similar code. So copy the file /components/com_weblinks/helpers/route.php
into /components/com_folio/helpers/route.php
, and then replace all the references to weblinks with the relevant details for our component. You will need to create the helpers
folder.
Please...