Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Niek van Hengel Friend
    #153577

    Hi,
    The search module imput area does not get smaller or bigger for the when I give in an amount of characters. I want to make it smaller so inserted 10 but nothing happens to the size. Please help.
    Thanks

    smitheringale Friend
    #352837

    I believe it may be coded in the php somewhere? usually I want to increase the size from 20 to something bigger and simply changing from 20 to 40 in the search module parameters doesn’t seem to do anything, and having saved and gone back into the search module it is suddently back at 20 characters again! I don’t think it’s controlled by a plugin – and I think the character length is coded by PHP and i’m pretty sure if you do a google search for something like

    “change length of characters in joomla search module” <– a search that is wayyyy more than 20 characters but worked for me – do you really want the search to be only 10 characters??

    might help you out – and in fact i stumbled across this page

    http://www.geekgumbo.com/2010/03/01/increasing-the-joomla-search-component-character-limitation/

    with this information

    Increasing the Joomla 1.5 Search Component character limitation
    Posted by imperialWicket | joomla | Monday 1 March 2010 11:50 am
    The default character limitation for the native Joomla! Search Module is 20 characters. Increasing this value requires a bit of Joomla! hacking, and although there are a number of resources for accomplishing this, I could not find any that pertained to the current (or even recent) Joomla 1.5 release.

    NOTE: You should not remove the maxlength entirely. As long as search times are non-critical to you, and your database is not enormous, making it 50 or 100 characters should make for a more appealing search interface in most cases.

    In order to change the search character limitation to 45, make the following changes:

    Note: The ” – -” means delete this, and the “++” means to add this back

    /modules/mod_search.php

    1
    — $maxlength = $width > 20 ? $width : 20;
    2
    ++ $maxlength = $width > 45 ? $width : 45;
    /components/com_search/views/search/tmpl/default_form.php

    1

    2
    <input id=”search_searchword” class=”inputbox” maxlength=”20″ name=”searchword” size=”30″ type=”text” value=”<?php echo $this->escape($this->searchword); ?>”>
    3
    ++
    4
    <input id=”search_searchword” class=”inputbox” maxlength=”45″ name=”searchword” size=”30″ type=”text” value=”<?php echo $this->escape($this->searchword); ?>”>
    /administrator/components/com_search/helpers/search.php

    1
    — // limit searchword to 20 characters
    2
    — if ( JString::strlen( $searchword ) > 20 ) {
    3
    — $searchword = JString::substr( $searchword, 0, 20 );
    4
    ++ // limit searchword to 45 characters
    5
    ++ if ( JString::strlen( $searchword ) > 45 ) {
    6
    ++ $searchword = JString::substr( $searchword, 0, 44 );
    /language/en-GB/en-GB.com_search.ini

    1
    — SEARCH_MESSAGE=Search term must be a minimum of 3 characters and a maximum of 20 characters.
    2
    ++ SEARCH_MESSAGE=Search term must be a minimum of 3 characters and a maximum of 45 characters.
    There you have it, enjoy!

    Thanks to the following:
    leeburstroghm – for pointing out that this change requires mods to the admin component in order to function properly on the front-end.

    m2d^ – for a helpful post that accomplished this update in an older version of Joomla! / the Joomla! Search Component. It’s close, but just distinct enough to make things tricky.

    <em>@nvhengel 190503 wrote:</em><blockquote>Hi,
    The search module imput area does not get smaller or bigger for the when I give in an amount of characters. I want to make it smaller so inserted 10 but nothing happens to the size. Please help.
    Thanks</blockquote>

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  smitheringale 14 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum