Moved search to header, lost search functionality
Moderator: Thorsten
-
- Posts: 13
- Joined: Thu Dec 15, 2011 4:13 am
Moved search to header, lost search functionality
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
I think yes.
If you check the index.php in line 484, there is a if clause searching for main.
Thorsten, could you comment?
If you check the index.php in line 484, there is a if clause searching for main.
Thorsten, could you comment?
Our public FAQ is proudly powered by phpMyFAQ: http://vhtfaq.ge51.honeywell.de/
Re: Moved search to header, lost search functionality
Hi,
yes, it cannot work because the template variables are not parsed.
bye
Thorsten
yes, it cannot work because the template variables are not parsed.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
-
- Posts: 13
- Joined: Thu Dec 15, 2011 4:13 am
Re: Moved search to header, lost search functionality
Is there any workaround to get this to work?
Re: Moved search to header, lost search functionality
Hi,
I need to know exactly what you've changed.
bye
Thorsten
I need to know exactly what you've changed.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
-
- Posts: 13
- Joined: Thu Dec 15, 2011 4:13 am
Re: Moved search to header, lost search functionality
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
Hi,
in which file did you placed that? index.tpl?
bye
Thorsten
in which file did you placed that? index.tpl?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
-
- Posts: 13
- Joined: Thu Dec 15, 2011 4:13 am
Re: Moved search to header, lost search functionality
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
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
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
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
-
- Posts: 13
- Joined: Thu Dec 15, 2011 4:13 am
Re: Moved search to header, lost search functionality
Instant Search on the home page is not enabled. Still can't seem to get this work.
This is how it appears:
This is how it appears:
Re: Moved search to header, lost search functionality
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
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
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Moved search to header, lost search functionality
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
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
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
-
- Posts: 13
- Joined: Thu Dec 15, 2011 4:13 am
Re: Moved search to header, lost search functionality
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.