Closed (duplicate)
Project:
Recipe
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2008 at 17:20 UTC
Updated:
28 Dec 2009 at 22:36 UTC
Ten ingredients isn't really enough for my purposes, so I'm trying to up the ingredient field to 20. The strange thing is that I previously did this by going into the code and changing one of the "num_ingredients" values to 20, which worked fine.
Then all of a sudden there's only 10 again. I went in and changed every "num_ingredient" reference to 20. Nowhere in the code does it say 10 ingredients, and yet it still only shows 10, no matter how many times I refresh. Any idea what could be causing this?
Thanks!
Comments
Comment #1
marble commentedYou can save and edit a recipe, and an additional 10 ingredient fields should appear. No code changes are necessary for that. (There's an existing issue open for adding a 'more ingredients' thing to let these appear during the initial edit.)
Comment #2
vagrant commentedThe module evidently reads the number of ingredients and automatically adds 10 to that number. If it's a new recipe then it will add 10, giving 10 lines. With the modification, it adds 20 to the initial number of ingredients.
You can change this line from:
for ($i = $num_ingredients; $i < $num_ingredients+10; $i++)
to
for ($i = $num_ingredients; $i < $num_ingredients+20; $i++)
it works for me,
enjoy
Comment #3
emmajane commentedCould the form also be themed to let people know 10 more ingredients will be added when the form is saved? We had a bit of a time last night trying to figure out how to add more items.
Comment #4
webluke commentedThis should relay start with like 5 fields for ingredients, and have an ajax type button that says [Add More] at the bottom of the list and it would add another line. This would keep the page length down but also keep you on the same page when your putting in a recipe.
Comment #5
Coyote commentedIt should also be possible to re-order the ingredients without having to manually erase and re-enter them.
Comment #6
tamitha commentedSubscribe.... the Ajax thing would be great!
Comment #7
tlogan commentedI'd love to see AJAX added to this as well. I agree that 5 is a good starting number.
Comment #8
hass commented#303678: Add more ingredients, need an easier (AJAX) method