views:

40

answers:

2

I'm using a Joomla 1.5 installation and the Joomla search component allows you to search in certain "search areas": Articles / News Feeds / Sections / Categories / Web Links ...

I don't want my users to have to worry about these things however and I also don't want them getting "sections" or "categories" as results - it's just a simple site with about 5 fixed pages and some simple news/event announcements that I use articles for.

I want to set some default "search areas" to use, and hide the search areas from the search results page. Hiding the search areas from the results page wasn't a problem - I just modified the default_form.php in the com_search component.

However, I have no idea how the "search areas" actually work and how I can change the functionality that the search function always only searches on "Articles" and nothing else...

There's two places where I can see it coming back:

In controller.php (in the com_search component) - you get the areas from the checkbox-list on the page:

    $areas = JRequest::getVar('areas', null, 'post', 'array');
    if ($areas) {
        foreach($areas as $area)
        {
            $post['areas'][] = JFilterInput::clean($area, 'cmd');
        }
    }

In search.php (also in the com_search component) - you get the areas as specified and add them as "active areas" for your search query:

    $areas = JRequest::getVar('areas');
    $this->setAreas($areas);

Instead I wish to add my own $areas variable, but I have no idea what it contains and how I might change it to a default value of only 'Articles'.

A: 

The areas are driven by the search plugins in the backend. Have a look at the list of plugins and disable the ones you don't want.

Jeepstone
A: 

Excellent! Exactly what I was looking for! Thank you!

Note: apparently Joomfish adds the same plugins again for searching for translations - so I disabled all of those except jfcontent as well.

Vicky