The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.



Post new topic Reply to topic  [ 18 posts ] 
Author Message
PostPosted: Fri Feb 24, 2012 11:34 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 21, 2010 10:47 pm
Posts: 22
Hi!
How can I change the 20 character limit string in search component in joomla. 2.5.1 to 40 or 50?


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 12:11 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 13, 2008 2:57 am
Posts: 20412
Location: Chennai, India
You have to change the file en-GB.localise.php that is located at \administrator\language\en-GB and \language\en-GB

You have to increase the value returned in the following function:
Code:
   public static function getUpperLimitSearchWord() {
      return 20;
   }

_________________
- Ilagnayeru (MIG) Manickam
http://www.eegan.org - helping the poor and underprivileged
educate. empower. enrich.
Support the poor and underprivileged


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 12:27 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 21, 2010 10:47 pm
Posts: 22
Hi!
I find the string and put 50 instead of 20, but still it returned that I had to use more than 20 character when I used over 20.

I even copy this part of the english file to nb-NO.localise.php - same result! Maybe i have to clean the cache in my browser?


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 12:37 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 13, 2008 2:57 am
Posts: 20412
Location: Chennai, India
You could try that. As this file is in 2 places, I believe that you have changed the file in both the places.

_________________
- Ilagnayeru (MIG) Manickam
http://www.eegan.org - helping the poor and underprivileged
educate. empower. enrich.
Support the poor and underprivileged


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 1:34 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 21, 2010 10:47 pm
Posts: 22
Hi!
First, thak you for helping me!
I did try another browser, but the same came up when I used more than 20 words. The to files are different, not only the language, but something is missing in the norwegian file. This you pointet out for me is not in the norwegian file. I did try top copy it to this file from the eng. But nothing happend. What do think I shoul do! Just change the name of the english file and place it under the norwegian lang. place?


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 1:41 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 21, 2010 10:47 pm
Posts: 22
Hi!
I have made changes to one of the files because I diden`t wont the customers se categori etc. Maybe I did damage the file! I will try with another site what you told me in the beginning!

Best regards
Rino smebye


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 1:47 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 21, 2010 10:47 pm
Posts: 22
Hi!
Now I have tryed another site, and used the english language to. But with the same result, and without damage one of the files :-) I did change it from 20 to 50!

Do you think of anything else I can try?

Best regards
Rino Smebye


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 3:09 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 13, 2008 2:57 am
Posts: 20412
Location: Chennai, India
In the Module Manager, in the module Search, hope you have changed the value of the option Box Width.

_________________
- Ilagnayeru (MIG) Manickam
http://www.eegan.org - helping the poor and underprivileged
educate. empower. enrich.
Support the poor and underprivileged


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 4:53 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 21, 2010 10:47 pm
Posts: 22
Hi!
In components\com_search\views\search\tmpl\default_form.php I did some deleteing and change the box width. Was that OK? Or should I do it elsewhere?


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 5:07 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 13, 2008 2:57 am
Posts: 20412
Location: Chennai, India
I do not know what you deleted. Have you changed the size of the box from 30 to a number above that?

Hope you are following the standard output override technique as documented at http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core.

_________________
- Ilagnayeru (MIG) Manickam
http://www.eegan.org - helping the poor and underprivileged
educate. empower. enrich.
Support the poor and underprivileged


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 7:27 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 21, 2010 10:47 pm
Posts: 22
Hi!
Ok! Maybe I can install a new search component to my Joomla 2.5.1 - where you have ajust this from 20 to 50 - and see if this works! I know this is a bit of job for you, and I am willing to pay you for it!

My template for Joomla I did in Artisteer 3


Top
 Profile  
 
PostPosted: Sat Feb 25, 2012 3:28 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 13, 2008 2:57 am
Posts: 20412
Location: Chennai, India
In the file default_form.php that is located in the directory \components\com_search\views\search\tmpl, you could change the value of size.
Code:
      <input type="text" name="searchword" id="search-searchword" size="30" maxlength="<?php echo $upper_limit; ?>" value="<?php echo $this->escape($this->origkeyword); ?>" class="inputbox" />

_________________
- Ilagnayeru (MIG) Manickam
http://www.eegan.org - helping the poor and underprivileged
educate. empower. enrich.
Support the poor and underprivileged


Top
 Profile  
 
PostPosted: Sat Feb 25, 2012 10:34 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 21, 2010 10:47 pm
Posts: 22
Hi.
I have changed the value to 50 and the box length was wider, but I could not type more than 20 characters with this adjustment either.

maxlength="<?php echo $upper_limit; ?>" her I just take away this in the middle maxlength="<??>" like this, and I could type as many word I wish in the search box, but still I get the message that I was not allowed to type more then 3-20 characters!

Where is this limitvalue hiding... :-)

Bet regards
Rino Smebye


Top
 Profile  
 
PostPosted: Tue Feb 28, 2012 9:28 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 21, 2010 10:47 pm
Posts: 22
Hei!
I find out another way to solve this! In the file Component\com_search\views\search\view.html.php I just deletet this area:

//limit searchword
$lang = JFactory::getLanguage();
$upper_limit = $lang->getUpperLimitSearchWord();
$lower_limit = $lang->getLowerLimitSearchWord();
if (SearchHelper::limitSearchWord($searchword)) {
$error = JText::sprintf('COM_SEARCH_ERROR_SEARCH_MESSAGE', $lower_limit, $upper_limit);
}

Maybe not the best way, but it did work!

Best Regards
Rino Smebye


Last edited by Rino Smebye on Sat Mar 03, 2012 10:01 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: Wed Feb 29, 2012 3:36 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 13, 2008 2:57 am
Posts: 20412
Location: Chennai, India
Good Job! Thanks for sharing the solution. This would help others who are looking for similar kind of solution.

_________________
- Ilagnayeru (MIG) Manickam
http://www.eegan.org - helping the poor and underprivileged
educate. empower. enrich.
Support the poor and underprivileged


Top
 Profile  
 
PostPosted: Tue Mar 06, 2012 1:28 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Fri Apr 17, 2009 10:39 am
Posts: 2
In your template create folder
html -> mod_search -> and copy here file default.php (from url: modules/mod_search/tmpl/default.php)

modify default.php

maxlength="'.$maxlength.'" to maxlength="'.$width.'"

In administration -> module -> search change width :)

I thing that it is best way.


Top
 Profile  
 
PostPosted: Sun Jul 15, 2012 5:13 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Jan 19, 2012 6:32 pm
Posts: 32
I am using the latest 2.5.6 and I am still not able to change the max 20 char?

I did go through the suggestions above, with still no change. I am using the "smart search com".

Any ideas??


Top
 Profile  
 
PostPosted: Mon Mar 04, 2013 10:29 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu Sep 22, 2011 11:05 am
Posts: 1
Changing the return-value of function "getUpperLimitSearchWord()" in
Quote:
[root]/language/[your-language]/[your-language].localise.php

on line 1059 works fine for me!!!


[your-language].localise.php
Quote:
public static function getUpperLimitSearchWord() {
return 50;
}


website source for search-form-input after modify
Quote:
<input name="searchword" id="mod-search-searchword" maxlength="50".../>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 



Who is online

Users browsing this forum: petergoeswest and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group