Add a search form anywhere to your OpenCMS website

If you would like to use the OpenCMS search tools provided in the content management system, here’s all you need to add anywhere you’d like it:

<form id="searchForm" name="searchForm" action="/opencms/opencms/yourwebsite/search.html" method="post">
<input type="hidden" name="action" value="search" />
<input type="hidden" name="searchPage" value="1" />
<input type="text" name="query" value="" />
<input type="submit" name="submit" value="Search" />
</form>

Keep in mind that in the content editor, this code will make two strange boxes appear. Those two boxes correspond to the hidden form elements and should not be deleted. If they are deleted, the search form will not function properly.

July 25, 2009  Tags: , ,   Posted in: Technology

Leave a Reply

Spam Protection by WP-SpamFree