Add a sitewide search form??:!:

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
stevenlyons
Posts: 69
Joined: Fri 2. Jul 2004, 01:46
Contact:

Add a sitewide search form??:!:

Post 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? :idea:

Thanks.
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post 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
stevenlyons
Posts: 69
Joined: Fri 2. Jul 2004, 01:46
Contact:

Post by stevenlyons »

Wow that works! Thanks Pepe.
stevenlyons
Posts: 69
Joined: Fri 2. Jul 2004, 01:46
Contact:

Post 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>
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post 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 :wink:


regards
pepe
stevenlyons
Posts: 69
Joined: Fri 2. Jul 2004, 01:46
Contact:

Post 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.
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post 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)
stevenlyons
Posts: 69
Joined: Fri 2. Jul 2004, 01:46
Contact:

Post 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?

Code: Select all

index.php?id=11,4,0,0,1,0
I am assuming it is the number 4 in this string?
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post by pepe »

Ok, i think so. Must be the 4 :!:
stevenlyons
Posts: 69
Joined: Fri 2. Jul 2004, 01:46
Contact:

Post by stevenlyons »

Yes it is the 4. It is now working. Thanks.
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post by pepe »

Im a lucky man today :lol:

pepe
mikimoto
Posts: 14
Joined: Fri 30. Jul 2004, 16:20

Post 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.

Code: Select all

<form action="" method="post"> 
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
Post Reply