Have you ever wanted to exclude one or more Joomla sections or categories from the built-in article search engine in Joomla 1.5? I have, several times in fact.
There are many extensions that harness Joomla content for there own uses - the powerful editing and categorization of content makes articles a natural choice for simple extensions, where implementing there own content sub-system would be overkill. Often these extensions will require the user to select one or more sections or categories for use within the extension - YOOcarousel, for example, requires the nomination of a single category from which it takes it's feed of slides/tab contents.
The downside is that these articles simply were not meant to be viewed as standalone pages - but if you have a site-wide search enabled on your website, Joomla will seek out and present article links to this very content.
True, you can hide certain articles within "Uncategorized" and choose the search to omit these pages from it's results; but what to do when you *need* to specify a section & category?
Well, I've taken the default Article search plug-in that ships with Joomla 1.5.22, and added some extra options in there to allow you to specify which sections, categories, and even individual articles should be omitted from the search results page.
Please Note: This plug-in is intended as a direct replacement to the core content search plug-in - it mostly uses the same code as the core version, so you must disable the core content plug-in before activating the new version. You should also note that the plug-in is for CORE CONTENT only and will not work on 3rd party extensions. If the core doesn't search for it, neither will this.
Installation is as with any other Joomla extension, via the normal extension installer.
Once installed, go to your Plug-in manager (Extensions->Plug-in Manager) and activate the new plug-in.
Click on the entry in the plug-in manager to set your global article search options in the normal way. You will see the three new exclusion boxes as below:
Simply enter any Article, Section or Category IDs you wish to omit from the search results and save the plug-in. You can exclude as many as you like, just remember to separate each ID with a comma. If you don't want to exclude any IDs of a particular type at all, just leave the box empty.
This version is intended to DIRECTLY REPLACE the pre-existing search plugin files. It contains only simple modifications to the SQL query and of course code to gather the IDs provided via the plugin manager. The Joomla 2.5 version ONLY supports individual article ID exclusions, nothing else. You can provide several IDs to exclude, as before separating each ID with a comma.
This version has been tested successfully on Joomla version 2.5.1. I will update this as and when it requires it (once subsequent versions of Joomla overwrite these files).
Please backup your existing files first, in case anything goes wrong, and read the disclaimer below before uploading these files.
The files must be extracted to your local machine, then uploaded to the /plugins/search/content/ folder on your server.
This Joomla extension is provided as-is without any guarantee or support. It's released under the GNU/GPL license. You are free to do with the extension as you please - take it apart, redistribute it, use it for any purposes, but please respect the conditions of the GPL and the original copyright holders (Joomla Project & OSM). You can view the GNU/GPL at http://www.gnu.org/copyleft/gpl.html.
As the plug-in uses only minor modifications to the original core code, it should work free of problems, but as always, please make a full site & database backup before trying it out, or test first in a safe environment.
The plug-in uses code from Joomla version 1.5.22, but should also work on older versions of the software. I will endeavor to release updates in the event that updates are made to the core plug-in code, but this is not guaranteed.