├── resources ├── screenshots │ ├── recipe01.png │ └── recipe02.png ├── css │ └── fields │ │ └── RecipeFieldType.css ├── js │ └── fields │ │ └── RecipeFieldType.js ├── star.svg ├── icon-mask.svg ├── icon.svg └── healthy.svg ├── composer.json ├── translations └── en.php ├── templates ├── fields │ ├── RecipeFieldType_Settings.twig │ └── RecipeFieldType.twig └── welcome.twig ├── LICENSE.txt ├── releases.json ├── RecipePlugin.php ├── fieldtypes └── RecipeFieldType.php ├── README.md └── models └── RecipeModel.php /resources/screenshots/recipe01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/recipe/master/resources/screenshots/recipe01.png -------------------------------------------------------------------------------- /resources/screenshots/recipe02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/recipe/master/resources/screenshots/recipe02.png -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nystudio107/recipe", 3 | "description": "A comprehensive recipe FieldType for Craft CMS that includes metric/imperial conversion, portion calculation, and JSON-LD microdata support", 4 | "require": { 5 | "composer/installers": "~1.0" 6 | }, 7 | "type": "craft-plugin" 8 | } -------------------------------------------------------------------------------- /translations/en.php: -------------------------------------------------------------------------------- 1 | 'To this', 16 | ); 17 | -------------------------------------------------------------------------------- /templates/fields/RecipeFieldType_Settings.twig: -------------------------------------------------------------------------------- 1 | {% import "_includes/forms" as forms %} 2 | 3 |
' ~ "No asset sources exist yet."|t ~ '
') }} 17 | {% endif %} 18 | 19 |Recipe adds a 'Recipe' FieldType for Craft CMS that you can add to any of your Sections.
17 |In encapsulates everything you need for a recipe, including the ingredients, a photo of the recipe, directions, cooking time, ratings, and even nutritional information. It handles converting between Imperial and Metric units, outputs 'pretty' fractions for Imperial units, and can output correct ingredient portions for any number of servings.
18 |Recipe also generates the JSON-LD microdata for your recipes if you have the SEOmatic plugin installed, which allows it to be displayed in the Google knowledge panel for search results.
19 |We hope Recipe makes it easier for you to create and share some yummy recipes!
20 |21 | 22 |
23 | 26 |29 | Brought to you by nystudio107 30 |
31 |No assets sources currently exist. Create one now...
104 | {% endif %} 105 | 106 | {{ forms.editableTableField({ 107 | id: id ~ 'ingredients', 108 | name: name ~ '[ingredients]', 109 | label: 'Recipe Ingredients' |t, 110 | instructions: "Enter the ingredients needed for this recipe by clicking on 'Add an Ingredient'. The quantity should be in decimal form." |t, 111 | required: false, 112 | static: false, 113 | cols: { 114 | quantity: { 115 | heading: "Quantity" |t, 116 | type: "number" |t, 117 | width: '5%', 118 | }, 119 | units: { 120 | heading: "Units" |t, 121 | type: "select" |t, 122 | width: '20%', 123 | options: { 124 | "": "", 125 | "tsps": "teaspoons" |t, 126 | "tbsps": "tablespoons" |t, 127 | "flozs": "fluid ounces" |t, 128 | "cups": "cups" |t, 129 | "ozs": "ounces" |t, 130 | "mls": "milliliters" |t, 131 | "ls": "liters" |t, 132 | "mgs": "milligram" |t, 133 | "gs": "gram" |t, 134 | } 135 | }, 136 | ingredient: { 137 | heading: "Ingredient" |t, 138 | type: "singleline" |t, 139 | width: '75%', 140 | }, 141 | }, 142 | rows: values.ingredients, 143 | addRowLabel: "Add an Ingredient" |t, 144 | locale: field.translatable ? locale, 145 | }) }} 146 | 147 | {{ forms.editableTableField({ 148 | id: id ~ 'directions', 149 | name: name ~ '[directions]', 150 | label: 'Recipe Directions' |t, 151 | instructions: "Enter the directions for this recipe by clicking on 'Add a Direction'." |t, 152 | required: false, 153 | static: false, 154 | cols: { 155 | direction: { 156 | heading: "Direction" |t, 157 | type: "multiline" |t, 158 | }, 159 | }, 160 | rows: values.directions, 161 | addRowLabel: "Add a Direction" |t, 162 | }) }} 163 | 164 | {{ forms.textField({ 165 | id: id ~ 'prepTime', 166 | type: 'number', 167 | class: 'nicetext', 168 | name: name ~ '[prepTime]', 169 | size: 3, 170 | label: 'Recipe Prep Time' |t, 171 | instructions: 'The number of minutes it takes to prep this recipe' |t, 172 | value: values.prepTime, 173 | errors: values.getErrors('prepTime'), 174 | required: false, 175 | locale: field.translatable ? locale, 176 | }) }} 177 | 178 | {{ forms.textField({ 179 | id: id ~ 'cookTime', 180 | type: 'number', 181 | class: 'nicetext', 182 | size: 3, 183 | name: name ~ '[cookTime]', 184 | label: 'Recipe Cook Time' |t, 185 | instructions: 'The number of minutes it takes to cook this recipe' |t, 186 | value: values.cookTime, 187 | errors: values.getErrors('cookTime'), 188 | required: false, 189 | locale: field.translatable ? locale, 190 | }) }} 191 | 192 | {{ forms.textField({ 193 | id: id ~ 'totalTime', 194 | type: 'number', 195 | class: 'nicetext', 196 | size: 3, 197 | name: name ~ '[totalTime]', 198 | label: 'Recipe Total Time' |t, 199 | instructions: 'The number of minutes it takes for this entire recipe' |t, 200 | value: values.totalTime, 201 | errors: values.getErrors('totalTime'), 202 | required: false, 203 | locale: field.translatable ? locale, 204 | }) }} 205 |