help with web site search

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
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

help with web site search

Post by handcoded »

Hi

I'm editing a template and have hard coded the search form so that the design of the search form matches the web site but there is probably a better way of doing this. From comparing the original search code my custom designed search is working fine apart from when clicking in the search field as the text stays and has to be deleted before a search can be performed.

I have added what I believe to be the correct javascript in order for this to work but no joy.

Could I have some advice about how I should correctly edit the search form so that my hacks are not necessary.

Site in question is www.handcoded.co.uk/eswav/

Thanks  ;D
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: help with web site search

Post by Dr.CSS »

You should look at the default install NCleanBlue theme CSS to see how you can use the existing template to make your search look the way you want with out hand coding it, it's actually very easy, I do it all the time, the text input and button/submit both have a class on them for styling ease...
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: help with web site search

Post by handcoded »

Hi

Thanks for the advice. I had a play and thought I was there as the search text vanished when I clicked into the search box but I have been unable to perform a search. Assuming I had made an error I restored the default search template but this will not work either. My code seems fine so I'm not sure what to do as uninstalling and re-installing the search module isn't doing the trick.

Here is my code

Code: Select all

<form id="cntnt01moduleform_1" method="get" action="http://handcoded.co.uk/eswav/" class="cms_form">
<div class="hidden">
<input type="hidden" name="mact" value="Search,cntnt01,dosearch,0" />
<input type="hidden" name="cntnt01returnid" value="15" />
</div>

    <label for="cntnt01searchinput">Search: </label><input type="text" class="search-input" id="cntnt01searchinput" name="cntnt01searchinput" size="20" maxlength="50" value="Search..." onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;"/><input class="search-button" name="submit" value="Submit" type="submit" />

</form>
Any advice would be welcomed.
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: help with web site search

Post by handcoded »

Hi

Just a quick update to say that I have put my styled search back which works perfectly on all pages except the home page and I don't know why. The home page uses a different template to the rest of the web site but the search block is contained within the header global content block and both templates when compared are identical until the main page content starts.

I'd be grateful for some help with this
www.handcoded.co.uk/eswav/

Thanks  :D
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: help with web site search

Post by handcoded »

Nearly there.

When searching from any page excluding the home page the search url begins with http://www.handcoded.co.uk/eswav/index.php

When searching from the home page the index.php part of the url is not entered therefore the search results are not displayed.

I'm unclear as to why this would happen and would be grateful for the answer.

Thanks
Post Reply

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