 |

welshchris
User
Apr 29, 2008, 7:49 AM
Post #1 of 2
(280 views)
Shortcut
|
|
Simple question re. search forms...
|
Can't Post
|
|
.... OK, I'm suffering a mental block here Can you tell me the code I have to insert in my templates to include a simple search form, similar to the one on the main page of the online demo where there is a single input field, submit button, and a link to go to advanced search? Thanks in advance! Chris
|
|
|  |
 |

MikeB
Staff
/ Moderator

Apr 29, 2008, 12:08 PM
Post #2 of 2
(273 views)
Shortcut
|
|
Re: [welshchris] Simple question re. search forms...
[In reply to]
|
Can't Post
|
|
Hi Chris, Thanks for the post! With the default templates, this search form that you see is actually something that is defined in this file: /templates/singlePages/siteHeader.html This means that the header text, etc. will also be shown if you decide to include this page. That said, there's an easy way to create a simple search form and here are the steps. 1. Create a new template file called "quickSearch.html" that you'll upload to /templates/singlePages/. In this file, you'll just have this HTML code:
<form class="search" method="post" action="$settings.searchurl$"> <p><input type="hidden" name="action" value="search" /> <input class="textbox" type="text" name="keyword" value="" /> <input class="button" type="submit" name="Submit" value="Search" /><br/> <a href="$settings.searchurl$">advanced search</a></p> </form> 2. Log into Article Manager and create a new publishing rule (Admin->Publishing) with these settings (anything I don't mention here you can leave as is): Rule Name: Quick Search Rule Description: Here you can put whatever makes sense for you Rule Type: a page with globalplaceholders Template: /templates/singlePages/quickSearch.html Placeholder Set Name: quickSearch Published File: quickSearch And that should be it! 3. Now, on your site you can include your search form with this include: <!--include virtual="$published.quickSearch.webPath$"--> If you're using this on a non-Article Manager page, the above won't work so you'll want to use: <!--include virtual="/artman/publish/quickSearch.shtml"--> Though you'll want to use a path that points to the appropriate folder on your site. I hope this helps! Cheers, Mike Briggs - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 | |  |
|