Wednesday, October 13, 2010

Increasing Number of Characters in Search Box in joomla

1. changed line 62-65 in administrator/components/com_search/helpers/search.php:


Code:
// limit searchword to 20 characters
if ( JString::strlen( $searchword ) > 50 ) {
$searchword    = JString::substr( $searchword, 0, 49 );
$restriction    = true;


I'm using Joomla 1.5 stable and I also didn't find the solution to increase the number of characters in search form.

I have done the following:

1. changed line 62-65 in administrator/components/com_search/helpers/search.php:
Code:
// limit searchword to 20 characters
if ( JString::strlen( $searchword ) > 50 ) {
$searchword    = JString::substr( $searchword, 0, 49 );
$restriction    = true;




2. changed line 12 in components/com_search/views/search/tmpl/default_form.php:
Code:
<input type="text" name="searchword" id="search_searchword" size="30" maxlength="50" value="<?php echo $this->escape($this->searchword); ?>" class="inputbox" />


3. changed line 24 in modules/mod_search/mod_search.php:
Code:
$width = intval($params->get('width', 50));


Regardless of all the changes I still can't input more than 20 characters in the search form.

Any new information on this?

In line 6 I had to change
Code:
$output = '<input name="searchword" id="mod_search_searchword" maxlength="20" alt="'.$button_text.'"


to

Code:
$output = '<input name="searchword" id="mod_search_searchword" maxlength="50" alt="'.$button_text.'"
.

tweaking 3 characters minimum limit (Joomla 1.5.15):

In file joomla/administrator/components/com_search/helpers/search.php , change to:
Line 47
> if (JString::strlen( $aterm ) < 2) {
Line 72
> if ( $searchword && JString::strlen( $searchword ) < 2 ) {



source: http://forum.joomla.org/viewtopic.php?f=472&t=209821

No comments:

Post a Comment