Recipes

A recipe here is not a page of text. Its ingredients are data: each line says which ingredient, how much, in which unit and in which group. That is what lets a visitor say "I want to make 20 kg" and see every amount recomputed — and order the spices the recipe needs with one button.

It is built the way everything else is built: a content type, a vocabulary, a paragraph type and views. Only the calculator is code.

The pieces

Piece What it is
Ingredients vocabulary One hierarchical vocabulary: Meat › Pork › VL…, Fats, Spices, Salts and additives, Cultures, Casings. Each ingredient has an abbreviation, a description and the product in the shop that sells it.
Recipe kinds vocabulary Meat products › Durable fermented › Fermented sausages; Confectionery; Dairy › Cheese; Wine…
Recipe line (paragraph type) Ingredient, quantity, unit (kg, g, m, ks, l), group (basic raw materials, additives, casings, cultures).
Recipe (content type) Number, standard, kind, photos, batch size (e.g. 100 kg of product), the lines, the calculator, the procedure, time.
Calculator (field type) Computed — nothing to fill in. Place it on the recipe's display.

One vocabulary, never one per ingredient

A new ingredient is a new term in the right branch of Ingredients — not a new vocabulary and not a new field on the recipe. A recipe that needs it simply picks it in a line.

The calculator

The visitor chooses one of two questions:

  • I want to make X kg — every line scales from the recipe's batch size. Gombasecká klobása is written for 100 kg; for 20 kg every amount is a fifth.
  • I have this much meat X kg — every line scales from the sum of the basic raw materials, for the visitor who starts from what is in the fridge.

Small amounts read in grams (0.12 kg shows as 120 g). A line whose ingredient has a product in the shop shows how many packs to order — 120 g of black pepper in 20 g bags is 6 bags — and Add all to the cart adds every such line at once.

Linking an ingredient to the shop

Open the ingredient (Taxonomy → Ingredients → e.g. Čierne korenie) and set Product in the shop. Every recipe that uses the ingredient now offers it — the link is made once, on the ingredient, never recipe by recipe. The pack size comes from the product's default variation (its weight).

Claudia

Claudia knows the workflow: she transcribes a photographed recipe table line by line into the recipe's lines, files a missing ingredient as a term in the right branch, and writes the procedure in her own words — the facts (ingredients, amounts, temperatures, times) are taken over exactly, a book's text never is.

Štítky
contentcommercerecipes