ria
ria

Reputation: 811

How to modify Joomla default search module?

I want to remove the label "Search" in Joomla search module (default search module). I have modified the default_form.php from the directory /joomla15/components/com_search/views/search/tmpl/ and even removed the following code but it makes no difference on the site:

<label for="search_searchword">
    <?php echo JText::_( 'Search Keyword' ); ?>:
</label>

Actually i am using an image button for the Search and I dont want the label to be displayed. What should I do to remove it?

Upvotes: 2

Views: 24718

Answers (3)

Thilanka De Silva
Thilanka De Silva

Reputation: 1088

Search module ---> basic options---> box label (type 1 or two space, then the "search..." will disappear)

Upvotes: 1

GmonC
GmonC

Reputation: 10970

You shouldn't be hacking Joomla Core Files. If you want to change a view from a component, you should use Template Overrides.

Second, if you're modifying your search component, you have to remember that the extensions in Joomla are divided in "Components", "Plugins" and "Modules". Every module is an extension, but not every extension is a module. It's a little different from other CMS's you may be used to.

That's why you can't change your search "module". You're searching for it's templates in components folder when you should be looking into "modules" folder as well.

There's a search module, that appears in all pages. This module is in JOOMA_PATH/modules/mod_search/tmpl/default.php, and you should be copying it to JOOMA_PATH/templates/TEMPLATE_NAME/html/mod_search/default.php to add your modifications. This is way, when updating your Joomla installation, you're not going to lose your customizations.

Upvotes: 6

Crozin
Crozin

Reputation: 44376

I never used Joomla! so I just guess but maybe there's some kind of template cache? Try to clear it.

But what you're trying to do is a very bad practice. This label makes your forms more available (for screen readers etc.). Don't try to remove this element - just hide it using CSS:

#mySearchForm label {
    display: none;
}

Upvotes: 4

Related Questions