[SOLVED] Underground theme : How to modify search form?

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
bob_basli
Forum Members
Forum Members
Posts: 189
Joined: Mon Sep 24, 2007 6:18 pm

[SOLVED] Underground theme : How to modify search form?

Post 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
Last edited by bob_basli on Mon Apr 06, 2009 1:22 pm, edited 1 time in total.
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Underground theme : How to modify search form?

Post by tyman00 »

Copy the {search} tag in and modify the search template in the admin to match the code you pasted above.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
bob_basli
Forum Members
Forum Members
Posts: 189
Joined: Mon Sep 24, 2007 6:18 pm

Re: Underground theme : How to modify search form?

Post 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
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Underground theme : How to modify search form?

Post 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.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
bob_basli
Forum Members
Forum Members
Posts: 189
Joined: Mon Sep 24, 2007 6:18 pm

Re: Underground theme : How to modify search form?

Post 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
bob_basli
Forum Members
Forum Members
Posts: 189
Joined: Mon Sep 24, 2007 6:18 pm

Re: Underground theme : How to modify search form?

Post 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,
bob_basli
Forum Members
Forum Members
Posts: 189
Joined: Mon Sep 24, 2007 6:18 pm

Re: Underground theme : How to modify search form?

Post 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?
uniqu3

Re: Underground theme : How to modify search form?

Post 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}
Last edited by uniqu3 on Fri Apr 03, 2009 10:48 am, edited 1 time in total.
swgreed

Re: Underground theme : How to modify search form?

Post 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>
bob_basli
Forum Members
Forum Members
Posts: 189
Joined: Mon Sep 24, 2007 6:18 pm

Re: Underground theme : How to modify search form?

Post 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.
Last edited by bob_basli on Fri Apr 03, 2009 11:51 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Underground theme : How to modify search form?

Post 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...
bob_basli
Forum Members
Forum Members
Posts: 189
Joined: Mon Sep 24, 2007 6:18 pm

Re: Underground theme : How to modify search form?

Post 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
Last edited by bob_basli on Mon Apr 06, 2009 6:37 am, edited 1 time in total.
bob_basli
Forum Members
Forum Members
Posts: 189
Joined: Mon Sep 24, 2007 6:18 pm

Re: Underground theme : How to modify search form?

Post 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.
bob_basli
Forum Members
Forum Members
Posts: 189
Joined: Mon Sep 24, 2007 6:18 pm

Re: Underground theme : How to modify search form?

Post 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.
Post Reply

Return to “Layout and Design (CSS & HTML)”