Forum Academy Marketplace Showcase Pricing Features

Loading the same icons loads of times

Long-time reader, first-time poster.

I’ve designed a flashcard that holds some recipes, ingredients, measurements, and associated icons - a png of a lime fruit to represent lime as an ingredient and so on.

I’m currently adding each ingredient icon to that database entry on upload but many recipes have the same ingredients and therefore the same icons. I’m basically uploading the same icons for each recipe.

Is there a way I can load an icon in an image element based on what information has loaded into another cell?

  • The word “Lime” gets loaded into a text cell from the database,
  • An image element loads lime.png with the name “Lime”

I really appreciate any help you can provide.

Hello @wonmedia !

My understanding is that every time you create a new recipe you need to create a database entry that holds the name of the ingredient and a picture, which involves the fact that you can have several database entries with the same name and/or picture.

If that is actually the case why don’t you store all the ingredients that have already been uploaded with their picture in a custom type in your DB ?
You would then have to offer the user the ability to look for already existing ingredient via a searchbox for example, but you still can leave them adding ingredient that have not been created yet.

Then, when you load all the recipes, you would only use the same database entries with the same name and picture instead of having to load multiple records holding the same informatio.

Let me know if you need help :slight_smile:

Thanks for the reply and offer of help,
I will keep you posted on how I get on.