Page 1 of 1
Add a sitewide search form??:!:
Posted: Sat 10. Jul 2004, 23:57
by stevenlyons
Sorry for barraging you all with posts. You have been very helpful.
I want to put a search form in a template. I have
searched the forums and I get a million results about this but with little relevant info.
Is search really only a Content Part? I don't understand the logic.
What if I want to put a search form in the left column of every page?
And how do I create the results page?
Thanks.
Posted: Sun 11. Jul 2004, 00:32
by pepe
Hi stevenlyons
Here is the solution:
Put the following code into your templates left col ( may be, {SPACER:5x1} = free space on the left side and "width:135px" = length of the field, need adaption)
-------------------------------------------------------------------------------------
<!-- search on the left col //-->
<form action="###search_input_action:3###" method="post">
{SPACER:5x1}<input name="###search_input_field###" type="text" size="10" maxlength="50" value="###search_input_value###" style="font-size:10px; width:135px;">
<input type="submit" value="search" style="font-size:10px;">
</form>
-------------------------------------------------------------------------------------
The 3 is the ID of the article, where you must place in the content-part "search".
The structure-element, where you have put in this article, can be hidden in the structure-menu.
pepe
Posted: Mon 12. Jul 2004, 23:30
by stevenlyons
Wow that works! Thanks Pepe.
Posted: Tue 13. Jul 2004, 00:13
by stevenlyons
oops wait I spoke too soon. It only works on the page with the search content part (the ID:9 page). It does not work on any other pages, even though the form is visible on all pages. ???
I have created a search structure level and a search page with a search content part. Here's the code I am using for the search form:
Code: Select all
<form action="###search_input_action:9###" method="post">
<input name="###search_input_field###" type="text" size="11" maxlength="50" value="###search_input_value###" style="font-size:10px;"><input type="submit" value="search" style="font-size:10px;">
</form>
Posted: Tue 13. Jul 2004, 10:18
by pepe
Hi stevenlyons,
the used ID (
9) must be the
ID of the article not of the structure level. Please proof it
What's the URL of your growing site? I'm interesting in what you are working on
regards
pepe
Posted: Tue 13. Jul 2004, 16:56
by stevenlyons
Thanks for your help, Pepe. I think I am already using the article ID, but just to make sure...exactly how do I find the article ID? Is it the ID that is shown in blue-grey in the content part summary (article page)?
Because I could not make it work, I have removed the search field from the template and now just have a link to the article that contains the search content part. You can see the early design here (nothing special--its a very simple site for a health watch-dog group):
Marin Health Fund
S.
Posted: Tue 13. Jul 2004, 17:30
by pepe
stevenlyons wrote:Thanks for your help, Pepe. I think I am already using the article ID, but just to make sure...exactly how do I find the article ID? Is it the ID that is shown in blue-grey in the content part summary (article page)?
Because I could not make it work, I have removed the search field from the template and now just have a link to the article that contains the search content part. You can see the early design here (nothing special--its a very simple site for a health watch-dog group):
Marin Health Fund
S.
You will find the
article ID, if you are in the
article center.
It's the ID, wich is shown in a little yellow window, if you are over the small
RED crossed field, just before the articlename.
You will see the Text:
article ID:xx then.
pepe
PS
Please proof, if there are unnecessary spacer in the used code
It might be possible, that that's the reason why... (It seems to be so)
Posted: Tue 13. Jul 2004, 17:53
by stevenlyons
That's interesting. I am using a mac and none of my browsers (Internet Explorer, Safari, Firebird, Opera ) show this. They do show the hint windows for the other interface widgets (cut, delete, etc), but not for the red x icon to the left of the article title. Is there a way to extract the article ID from the URL?
I am assuming it is the number 4 in this string?
Posted: Tue 13. Jul 2004, 17:59
by pepe
Ok, i think so. Must be the 4
Posted: Tue 13. Jul 2004, 18:05
by stevenlyons
Yes it is the 4. It is now working. Thanks.
Posted: Tue 13. Jul 2004, 18:12
by pepe
Im a lucky man today
pepe
Posted: Tue 3. Aug 2004, 11:32
by mikimoto
Hello
I have created the search page and it works, but when i put the search tool in the template don't have the action in the form.
My search page have ID 19 and i have this in the template
Code: Select all
<form action="###search_input_action:19###" method="post">
¿What's wrong?
Thanks