Hi there,
I have a cookingrecipe page and have the recipes sorted by... fish, pork, beef, vegetarian....
Recently I added the option to find recipes by ingredient... tomato, potato etc...
(people go to a page where I added "all" links to recipes about certain ingredient)
the problem is that I add recipes constantly and many times forget to add the link on the "ingredient" page, it's also a lot more work
I am trying now to replace the "search button" and "search field" by the "searchterm"... so visitors can directly click on a "ingredient link" and find all recipes containing the ingredient
How can I transform this into a "clickable link"?
<form action="/en/" method="post"><div id="searchbox"><input class="text" name="search" size="17" type="text"><input name="function" value="search" type="hidden"> <input class="submit" value="Search" type="submit"></div></form>
Example:
the link: potato ... will result in a search of all recipes that contain the word potato and therefore lead visitors to a list with "all" recipes.... this is much easyer than add hundrets of links by hand!!!!
Can you help me?
Replace search button by different texts to be searched
-
- Posts: 9
- Joined: Sun Sep 14, 2008 3:47 am
Re: Replace search button by different texts to be searched
Try to replace the
function searchbox() {
with this code:It is not exactly what you mean, but seems to be wery close. I have not yet found how to use multiple choice. Maybe a simple plugin for easier administration would be worth.
****
Something like this: tata_search. It is very simple plugin. But for someone more skilled than myself it may be a starting idea for some more advanced plugin(multiple choice, some design if used on a page instead in the template...).
Tryon page or in template
function searchbox() {
with this code:
Code: Select all
function searchbox() {
global $sn, $tx;
return '
<form action="'.$sn.'" method="post">
<div id="searchbox">
<select name="search" size="2">
<option value="apples" SELECTED>apples</option>
<option value="carrots">carrots</option>
<option value="onion">onion</option>
<option value="chilli">chilli</option>
<option value="jalapenos">jalapenos</option>
</select>
'.tag('input type="hidden" name="function" value="search"').'
'.tag('input type="submit" class="submit" value="'.$tx['search']['button'].'"').'
</div>
</form>';
}
****
Something like this: tata_search. It is very simple plugin. But for someone more skilled than myself it may be a starting idea for some more advanced plugin(multiple choice, some design if used on a page instead in the template...).
Try
Code: Select all
#cmsimple $output.=tata_search();#
Code: Select all
<?php echo tata_search()'?>
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Replace search button by different texts to be searched
Just add two parameters - &function=search (to call the search function) and &search=search_term (to define what to look for) - to your links.
Something like thiswould e.g. return a list of all pages containing the word potato.
Something like this
Code: Select all
http://www.your_site.com?your_recipe_index&function=search&search=potato