Modifying default search module

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Monkofdoom
Forum Members
Forum Members
Posts: 15
Joined: Wed Oct 28, 2009 1:38 pm

Modifying default search module

Post by Monkofdoom »

Hello, this is my first post here but I've been playing around with CMSMS for a little while... It's now time for me to progress my understanding of it to the further depths.

I have got a clean installation of 1.6.6 with no additional plugins/addons as of yet.

I'm looking to make a small modification to the default search system and how it displays the search box/button etc.

I have gone through the source code and tracked down to Modules -> Search -> Search.module.php and found:

Code: Select all

  {
    return '{$startform}

    <label for="{$search_actionid}searchinput">{$searchprompt}: </label><input type="text" class="search-input" id="{$search_actionid}searchinput" name="{$search_actionid}searchinput" size="20" maxlength="50" value="{$searchtext}" {$hogan}/><input class="search-button" name="submit" value="{$submittext}" type="submit" />
{if isset($hidden)}{$hidden}{/if}

{$endform}';
  }
Now I assumed this was where the input boxes got called out for the page and made some small modifications. However I can see no change on my site. To the extent that when I deleted all the code within the {} it made no difference. Yes I am 100% sure it's be saved to the right place etc.

So am I missing something? Have I edited the wrong file? Or do I need to press a button for CMSMS to pick up the changes I've made?

Thank you for your time and if you have any further questions which will help me solve this problem then please feel free to ask them.

- Monk
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Modifying default search module

Post by RonnyK »

Why are you making the changes in the files (that will be overwritten in an upgrade)...

Search is called in the templates attached to a page, and are styled in the stylesheets as you could call search within a div#search f.e.

Ronny
Monkofdoom
Forum Members
Forum Members
Posts: 15
Joined: Wed Oct 28, 2009 1:38 pm

Re: Modifying default search module

Post by Monkofdoom »

Thank you for your response.

I appreciate that the styling / changing can in a lot of cases be done in css etc but this time round I'm just wondering about how to actually make the changes to the root modules. It's not so much a I need to do it as it's obviously not advisable with these kinda systems but it's desire to learn how the system works as I play around.

I assumed editing that file would have an immediate effect on the website but it seems it doesn't, so I'm just trying to find out why. I worded my last post how I did as I wanted to try and explain clearly what I was trying to achieve and not so much why. I apologise for the confusion.
grinpin
New Member
New Member
Posts: 7
Joined: Mon Nov 26, 2007 8:05 am

Re: Modifying default search module

Post by grinpin »

same here, I edited search.module.php but with no result

I wanted to change type="submit" to type="image"

RonnyK -> of course you put {search} in template, and of course you can style "search" in css, but you can't change some things there, especially that mentioned above :)

but in the end, there is no need to change anything in the files, just css as you said ;)
Last edited by grinpin on Wed Feb 17, 2010 11:51 pm, edited 1 time in total.
Post Reply

Return to “Developers Discussion”