Contents |
{{ Restaurant
| Cuisine = Italian
| MaximumPartySize = 12
| CreditCards = American Express, Visa
}}
These template calls are essentially tables of named data; each one has a set of name-value pairs. In this case, the template call represents a restaurant whose cuisine is Italian, which takes American Express and Visa, and which can seat a maximum of 12 people in a party.
Search templates can answer questions like "Show me every section using the Restaurant template where Cuisine is 'Italian'" or "Show me every section using the Restaurant template where MaximumPartySize is greater than 8 and CreditCards contains 'Visa' and Cuisine is either 'Italian', 'French' or 'Chinese'".
Party Size: <input name="MinimumPartySize" type="text" match="MinimumPartySize <= MaximumPartySize"/> Credit Cards: <input name="AmericanExpress" type="checkbox" match="CreditCards contains 'American Express'"/> American ExpressThis is just a regular HTML form, but with the addition of a "match" attribute. The match attribute contains a boolean expression in Lingua; a "boolean expression" is just a statement that evaluates to true or false. When the search template is used, each one of the matches will be executed against the set of name-value pairs from the template call. In this search template, we have two input elements. The first is a text field that lets us establish the number of people in the party and ensure that the restaurant can seat that many. The second requires that the restaurant take American Express. So, for example, if we had three sections, each of which had a different call to the Restaurant template:
===Rocco's===
{{ Restaurant
| Cuisine = Italian
| MaximumPartySize = 6
| CreditCards = American Express, Visa
}}
===Le Fromage===
{{ Restaurant
| Cuisine = French
| MaximumPartySize = 8
| CreditCards = Visa
}}
===Golden Dragon===
{{ Restaurant
| Cuisine = Chinese
| MaximumPartySize = 12
| CreditCards = American Express
}}
If we entered "8" into the search template under party size, and checked the American Express box, the search template would evaluate each template call using the logic in the match attributes. For Rocco's, the search template would check "MinimumPartySize <= MaximumPartySize"; here the MinimumPartySize is 8 from the search template, and the MaximumPartySize is 6, from the template call. Eight is not less than or equal to six, so this test fails, and the search template rejects Rocco's.
Next, the search template looks at Le Fromage. Here, the MaximumPartySize is 8, which is equal to the party size we requested, so this test passes. The search template now looks at the next match attribute, "CreditCards contains 'American Express'". CreditCards is just "Visa" for Le Fromage, so this test fails, and we reject Le Fromage.
Finally, we test Golden Dragon. 8 is less than 12, so our MinimumPartySize is less than or equal to our MaximumPartySize, and thus this test passes. CreditCards for Golden Dragon does contain "American Express", and thus the second test also passes. Since all of our criteria have been met, Golden Dragon is a match, and will be included in the results of the search.
Party Size: <input name="MinimumPartySize" type="text" match="MinimumPartySize <= MaximumPartySize"/> Credit Cards: <input name="AmericanExpress" type="checkbox" match="CreditCards contains 'American Express'"/> American Express <tags>restaurants</tags>Now, when a user clicks on the tag "restaurants" in the tag brower, he or she will see this search template. Unlike regular pages, though, multiple "tags" elements are treated separately. For example, if our tags looked like:
Party Size: <input name="MinimumPartySize" type="text" match="MinimumPartySize <= MaximumPartySize"/> Credit Cards: <input name="AmericanExpress" type="checkbox" match="CreditCards contains 'American Express'"/> American Express <tags>restaurants</tags> <tags>food,dining</tags> <tags>nightlife,eats</tags>Then our search template would only show up if the user picked "restaurants", or picked both "food" and "dining", or picked "nightlife" and "eats". If the use only picked "dining" or only picked "nightlife", our search template wouldn't show up, since we haven't matched all the tags in each "tags" element.
#QUESTION Are you looking for a restaurant? Party Size: <input name="MinimumPartySize" type="text" match="MinimumPartySize <= MaximumPartySize"/> Credit Cards: <input name="AmericanExpress" type="checkbox" match="CreditCards contains 'American Express'"/> American Express <tags>restaurants</tags> <tags>food,dining</tags> <tags>nightlife,eats</tags>
Povo is a wiki, which means that our users can change the content of the site at any time. By claiming your business or organization, we can make sure that the basic information about your business is protected. Give us a name and phone number, and we'll contact you.
Provide us with contact information about your business or organization:
Povo is a wiki, which means that our users can change the content of the site at any time. By claiming your business or organization, we can make sure that the basic information about your business is protected. Give us a name and phone number, and we'll contact you.
Provide us with contact information about your business or organization:
In order to use the personalized aspects of Povo such as reviews, ratings, and email notifications of changes, you must create an account. The only requirement is to pick a member name and a password. If you give us an email address, we will not ever sell it to a third party or spam you. For more details you can see our privacy policy.
(optional)