2

I am using sh404SEF on my website for a large organization. On the custom 404 page, I have already published the search boxes for the different Zoo application databases that the site uses. It's similar to "find a job" and "find a store location". Those search boxes are separate from searching the site for actual content. I think having a third module for "search the site" after having the others would be way too many modules.

So I want to put a search box in the body of the 404 page that searches the actual content. Already on the custom sh404 404 page, it says the name of the searched page dynamically then offers 3-5 possible choices of "correct" links. I want to also have a search box at the end there in that content for when the choices aren't helpful.

What's a lightweight solution to that? I can load a module position there and load a search module in the content, but that seems too nested.

Thoughts?

4

You could try inserting the HTML that is generated from the mod_search module directly:

<form action="index.php" method="post" class="form-inline" _lpchecked="1">
     <input name="searchword" id="mod-search-searchword" maxlength="20" class="inputbox search-query" type="text" size="20" value="Search..." onblur="if (this.value=='') this.value='Search...';" onfocus="if (this.value=='Search...') this.value='';">       
     <input type="hidden" name="task" value="search">
     <input type="hidden" name="option" value="com_search">
     <input type="hidden" name="Itemid" value="101">
</form>

It's not the most elegant way to do it, but it should work, and it's the most lightweight solution I can think of.

  • That worked perfectly. 6 lines of code. Did what it needed to do. – Toni Marie Nov 7 '14 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.