Page 1 of 1
[SOLVED] Underground theme : How to modify search form?
Posted: Wed Apr 01, 2009 6:57 am
by bob_basli
Hi all,
This is the search form code in the Underground Theme.
Code: Select all
<form method="post" class="search" action="#">
<p><input name="search_query" class="textbox" type="text" />
<input name="search" class="searchbutton" value="Zoek" type="submit" /></p>
</form>
How do I modify the action so it will use the search engine used in cmsms to search my page?
I tried copying the {search} in, but that messes up the template.
Kind regards,
Arjan
Re: Underground theme : How to modify search form?
Posted: Wed Apr 01, 2009 2:32 pm
by tyman00
Copy the {search} tag in and modify the search template in the admin to match the code you pasted above.
Re: Underground theme : How to modify search form?
Posted: Thu Apr 02, 2009 5:51 am
by bob_basli
Thanks, but now the next question is what to enter at the action. Default it's action"#" but I don't know what to enter there, in order to make the search
Re: Underground theme : How to modify search form?
Posted: Thu Apr 02, 2009 2:43 pm
by tyman00
Forget about the search form code that shipped with the underground theme. You want to use the search tag. You can modify the search template for the tag. Just call the necessary classes and styles to make sure it formats correctly.
Re: Underground theme : How to modify search form?
Posted: Fri Apr 03, 2009 8:11 am
by bob_basli
I'm using this code now, but it does not display properly.
Added the classes to where I think they shoud be, just don't know where to put the from the form tag.
Probably that's why it's not diplaying like I would like it to be.
Code: Select all
{$startform}
<label for="{$search_actionid}searchinput">{$searchprompt}</label>: <input class="textbox" type="text" id="{$search_actionid}searchinput" name="{$search_actionid}searchinput" size="20" maxlength="50" value="{$searchtext}" {$hogan}/><input name="submit" class="searchbutton" value="{$submittext}" type="submit" />
{if isset($hidden)}{$hidden}{/if}
{$endform}
Am not that good into codes yet, so I could use a little help.
Thanks in advance
Re: Underground theme : How to modify search form?
Posted: Fri Apr 03, 2009 9:42 am
by bob_basli
@ Quicksteve: Thanks, it helps me a bit searching for it.
The only problem i still have is that the searchbox is as wide as my entire page and therefor under my pagetitle. Where do I adjust the size of the searchmodule in the CSS?
Regards,
Re: Underground theme : How to modify search form?
Posted: Fri Apr 03, 2009 10:28 am
by bob_basli
Yes I am using the tag {search}
This is the code in the css
Code: Select all
/* search form */
form.search {
position: absolute;
top: 5px; right: 5px;
padding: 0; margin: 0;
border: none;
background-color: transparent;
}
form.search input.textbox {
margin: 0;
width: 120px;
border: 1px solid #CCC;
background: #FFF;
color: #333;
}
form.search input.searchbutton {
margin: 0;
font-size: 100%;
font-family: Arial, Sans-serif;
border: 1px solid #CCC;
background: #FFFFFF url(uploads/mysite/headerbg.gif) repeat-x bottom left;
padding: 1px;
font-weight: bold;
height: 23px;
color: #333;
width: 60px;
}
This is the standard code for the searchtemplate
Code: Select all
{$startform}
<label for="{$search_actionid}searchinput">{$searchprompt}</label>: <input type="text" id="{$search_actionid}searchinput" name="{$search_actionid}searchinput" size="20" maxlength="50" value="{$searchtext}" {$hogan}/><input name="submit" value="{$submittext}" type="submit" />
{if isset($hidden)}{$hidden}{/if}
{$endform}
What do I need to change and where because I seem not to get it straight.
What do I need to change and where?
Re: Underground theme : How to modify search form?
Posted: Fri Apr 03, 2009 10:34 am
by uniqu3
put in the css
Code: Select all
.search{
width:your desired width px;}
and that should do it.
Edit:
Actualy adding classes to the form template should solve your problem.
Code: Select all
{$startform}
<div class="search>
<label for="{$search_actionid}searchinput">{$searchprompt}</label>: <input type="text" id="{$search_actionid}searchinput" class="textbox" name="{$search_actionid}searchinput" size="20" maxlength="50" value="{$searchtext}" {$hogan}/><input class="searchbutton" name="submit" value="{$submittext}" type="submit" />
{if isset($hidden)}{$hidden}{/if}
</div>
{$endform}
Re: Underground theme : How to modify search form?
Posted: Fri Apr 03, 2009 11:19 am
by swgreed
in the underground theme, you could also use the following code
Code: Select all
<form class="search" id="cntnt01moduleform_1" method="get" action="index.php">
<div class="hidden">
<input type="hidden" name="mact" value="Search,cntnt01,dosearch,0" />
<input type="hidden" name="cntnt01returnid" value="15" />
</div>
between
Code: Select all
<div id="header-logo" >[...] </div>
Re: Underground theme : How to modify search form?
Posted: Fri Apr 03, 2009 11:43 am
by bob_basli
swgreed,
It's not displaying anything. Sorry
I'm using this code now:
Code: Select all
<form class="search" id="cntnt01moduleform_1" method="get" action="index.php">
<div class="hidden">
<input type="hidden" name="mact" value="Search,cntnt01,dosearch,0" />
<input type="hidden" name="cntnt01returnid" value="15" />
</div>
<p><input name="search_query" class="textbox" type="text" />
<input name="search" class="searchbutton" value="Search" type="submit" /></p>
</form>
On the return page I get
Results for "" No results
I'm on the right track but have to define the input.
It looks like in the code from swgreed an input field is not defined and my input between the tags is not used.
Re: Underground theme : How to modify search form?
Posted: Fri Apr 03, 2009 5:32 pm
by Dr.CSS
If you had put a link to this and we could see the css you were trying to use it would help...
Re: Underground theme : How to modify search form?
Posted: Mon Apr 06, 2009 6:35 am
by bob_basli
bob_basli wrote:
swgreed,
It's not displaying anything. Sorry
I'm using this code now:
Code: Select all
<form class="search" id="cntnt01moduleform_1" method="get" action="index.php">
<div class="hidden">
<input type="hidden" name="mact" value="Search,cntnt01,dosearch,0" />
<input type="hidden" name="cntnt01returnid" value="15" />
</div>
<p><input name="search_query" class="textbox" type="text" />
<input name="search" class="searchbutton" value="Search" type="submit" /></p>
</form>
On the return page I get
Results for "" No results
I'm on the right track but have to define the input.
It looks like in the code from swgreed an input field is not defined and my input between the tags is not used.
According to this, the layout in the website is ok now!
Unforunately, the search itself is not working. When entering a search-string the module responds with No Results and does not enter the search word(s) for searching. So now what I'm looking for is the proper way/name for the proper field to use for the part where you enter the search string in order to get the searchmodule to work.
My guess is that thit's in this part but am not sure:
Code: Select all
<input name="search_query" class="textbox" type="text" />
Regards,
Arjan
Re: Underground theme : How to modify search form?
Posted: Mon Apr 06, 2009 6:45 am
by bob_basli
swgreed wrote:
in the underground theme, you could also use the following code
Code: Select all
<form class="search" id="cntnt01moduleform_1" method="get" action="index.php">
<div class="hidden">
<input type="hidden" name="mact" value="Search,cntnt01,dosearch,0" />
<input type="hidden" name="cntnt01returnid" value="15" />
</div>
between
Code: Select all
<div id="header-logo" >[...] </div>
It seems this code is missing a defined input field and submit button. When applying this code to the template there is no field to enter a search string. When I added my own input code
Code: Select all
<p><input name="search_query" class="textbox" type="text" />
<input name="search" class="searchbutton" value="Search" type="submit" /></p>
The response for the query is:
Results for "" No results
Which indicated that whatever I enter in my input-field is not used by the form / searchmodule.
Re: Underground theme : How to modify search form?
Posted: Mon Apr 06, 2009 1:22 pm
by bob_basli
GOT IT WORKING
by entering following code to my template and leaving the css as it was.
Code: Select all
<form class="search" id="cntnt01moduleform_1" method="get" action="index.php">
<div class="hidden">
<input type="hidden" name="mact" value="Search,cntnt01,dosearch,0" />
<input type="hidden" name="cntnt01returnid" value="15" />
</div>
<p><input type="text" id="cntnt01searchinput" name="cntnt01searchinput" size="20" maxlength="50" /><input name="submit" value="Zoek" type="submit" /></p>
</form>
Finally solved thanks to wiki tutorial and help from the guys in the forum.