6

I am planning to make a recipe channel (yes food/meal recipes).

This would require an ingredient list. I plan to create a matrix field with rows for each ingredient. This matrix would have a qualtity column (i.e "1 tblsp") and a ingredient column.

I wish for the ingredient field in the row to be a relationship selection (e.g playa) so that we can maintain a list of ingredients, and it also would allow us to see all recipes that use a particular ingredient. The reason why ingredients need their own channel is because many ingredients will have meta data around them because they are sponsored and may have a link associated where a person could buy that ingredient.

My question is:

How would you go about enabling people to create a NEW ingredient while building the recipe without breaking the workflow? Many times I expect the ingredient to exist but not until many recipes have been data entered.

I would love a modal inline safecracker form to popup to submit the ingredient entry but am not sure if playa has a js trigger for selecting a 'new' option in the playa list.

  • If this functionality could be created...that would be...awesome. – Jason Varga Jan 30 '13 at 1:46
  • @JasonVarga yes it would. not sure if it exists anywhere? – lukemh Jan 30 '13 at 1:48
  • Have wanted this forever. So many challenges in building this though. – Derek Hogue Jan 30 '13 at 2:15
2

You could use the Instructions for your field to link to the Publish page for your Ingredients channel in a new window, but you would have to refresh the current entry page to see the new entry, which would lose any edits you made.

Maybe have a frame in the new window with a close button that triggers a save in the original window and then redirects back to the entry?

If you use Safecracker, you could do the new entry in a modal frame/lightbox and have more programmatic control over refreshing the original form.

| improve this answer | |
  • This is a solution I considered, but does feel a little clunky. I will probably go down this path if a better solution is not discovered. – lukemh Jan 30 '13 at 1:51
  • you could try using Fanceebox for this. I think I've tried this in the past though, I don't remember if it worked or not to be honest. – Natetronn Jan 30 '13 at 2:16
  • You'd have to refresh the page to actually see the new entry available in the Playa field's initial list, but... if you type to filter in the Playa field it will find the new entry even if the page isn't refreshed (because the entries are loaded via ajax). Not perfect, but it does allow you to publish a new ingredient entry in a separate tab or modal and still find it in the Playa field without a page refresh. – Alex Kendrick Jan 30 '13 at 4:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.