Page 1 of 1

Moved search to header, lost search functionality

Posted: Sun Dec 18, 2011 5:55 am
by timcappalli-lyndon
I moved the search code from the main content area to the header and now the search functionality has been lost. Instead of showing the proper text in the button (Search) and below the bar (Advanced search), the text displays the variables. When I click the search button, I get a page cannot be displayed because the variable isn't being replaced. Does this piece of code not get processed until the content area?

Re: Moved search to header, lost search functionality

Posted: Wed Dec 21, 2011 5:17 pm
by JochenS
I think yes.
If you check the index.php in line 484, there is a if clause searching for main.

Thorsten, could you comment?

Re: Moved search to header, lost search functionality

Posted: Wed Dec 21, 2011 5:31 pm
by Thorsten
Hi,

yes, it cannot work because the template variables are not parsed.

bye
Thorsten

Re: Moved search to header, lost search functionality

Posted: Wed Dec 21, 2011 6:44 pm
by timcappalli-lyndon
Is there any workaround to get this to work?

Re: Moved search to header, lost search functionality

Posted: Thu Dec 22, 2011 2:40 pm
by Thorsten
Hi,

I need to know exactly what you've changed.

bye
Thorsten

Re: Moved search to header, lost search functionality

Posted: Thu Dec 22, 2011 2:56 pm
by timcappalli-lyndon
I literally took the code from the main content area in the index and moved it to the header. Code below:

Code: Select all

<!-- <div id="searchBox-header">
        [globalSearchBox]
		<a href="http://www.lyndonstate.edu/" target="_blank">Lyndon Home</a>
            <form id="search" action="{writeSendAdress}" method="get">
                <input type="hidden" name="searchcategory" value="{categoryId}" />
                <input type="hidden" name="action" value="search" />
                <input type="search" name="search" id="searchfield" size="30" placeholder="Search ITS" />
               <input type="submit" name="submit" value="Go" /> 
				<!-- <input type="image" size="16" src="/template/lyndonits/images/search.gif" value="{searchBox}"/> 
            </form>
            {msgSearch}
        [/globalSearchBox]
        </div> -->

Re: Moved search to header, lost search functionality

Posted: Sat Dec 24, 2011 12:33 pm
by Thorsten
Hi,

in which file did you placed that? index.tpl?

bye
Thorsten

Re: Moved search to header, lost search functionality

Posted: Sat Dec 24, 2011 5:20 pm
by timcappalli-lyndon
Correct. Here is the entire section of the index.tpl (right now the search is commented out)

Code: Select all

<div id="header-wrapper">
<header id="header">
<div id="header-logo">
    <a href="http://it.lyndonstate.edu"><img src="/template/lyndonits/images/ITS-Header-Logo.png" alt="Lyndon ITS Logo"/></a>
</div>

<div id="header-search">
<!-- <div id="searchBox-header">
        [globalSearchBox]
		<a href="http://www.lyndonstate.edu/" target="_blank">Lyndon Home</a>
            <form id="search" action="{writeSendAdress}" method="get">
                <input type="hidden" name="searchcategory" value="{categoryId}" />
                <input type="hidden" name="action" value="search" />
                <input type="search" name="search" id="searchfield" size="30" placeholder="Search ITS" />
               <input type="submit" name="submit" value="Go" /> 
				<!-- <input type="image" size="16" src="/template/lyndonits/images/search.gif" value="{searchBox}"/> 
            </form>
            {msgSearch}
        [/globalSearchBox]
        </div> -->
</div>

</header>

Re: Moved search to header, lost search functionality

Posted: Mon Dec 26, 2011 5:32 pm
by Thorsten
Hi,

this should work. Did you enabled the Ajax Instant Search on the start page in the admin configuration? If yes, please disable it.

bye
Thorsten

Re: Moved search to header, lost search functionality

Posted: Mon Jan 02, 2012 10:48 pm
by timcappalli-lyndon
Instant Search on the home page is not enabled. Still can't seem to get this work.

This is how it appears: Image

Re: Moved search to header, lost search functionality

Posted: Tue Jan 03, 2012 7:39 am
by Thorsten
Hi,

could you please send me your templates by e-mail, I can check it on my testsystems. My e-mail address is thorsten AT phpmyfaq DOT de

bye
Thorsten

Re: Moved search to header, lost search functionality

Posted: Tue Jan 03, 2012 4:35 pm
by Thorsten
Hi,

I found the issue: you have to remove the second [globalSearchBox], because only the last template block is parsed. If you remove it, it works.

bye
Thorsten

Re: Moved search to header, lost search functionality

Posted: Sat Jan 21, 2012 10:59 pm
by timcappalli-lyndon
That seemed to work for the most part. The new issue seems to be that on certain pages, the search portion of that box does not appear. I added custom text above the search box and that seems to stay. The pages I noticed that the search box didn't appear were the actually FAQ pages, the contact pages, and any custom pages I added.

Image