Crocoblock / suggestions

The suggestions for CrocoBlock project
193 stars 78 forks source link

JetEngine: Upload files (SVG) to Glossaries #5792

Open pauserratgutierrez opened 1 year ago

pauserratgutierrez commented 1 year ago

Before adding a new feature request, please, make sure you’ve checked:

Please, describe the feature request, making it clear to understand.

Specify the feature, the product to which it should be added, and why it is important to add it. Describe what effect or functionality you want to achieve as a result.

The Glossaries are a good starting point but they don't allow to save nothing more than text. Sometimes we want to store there more useful information such as an image.

In my case I find in a situation where I need to design a menu template for a restaurant. I need to display allergens of each food so that the customers know if they can choose the dish based on allergies or foot preferences. I have a "Menú" Custom Post Type with a repeater field for each dish. The repeater field asks for: "dish name" and "allergens". That last one is done using a Checkbox (or select). Each allergen is dynamically pulled from a Glossary.

To display the checkbox info of each dish (allergen) I use the Dynamic field widget (with filter field output pulling data from the allergen glossary). The problem is that the data is pulling is only the name of the allergen. If the glossary allowed me to asign an image to that same name, I will be able to dynamically pull the image instead of the name.

Glossary of Allergens (I need to add each image to each allergen, here "Gluten"): image

Menu CPT Select pulling from the Allergen Glossary: image

Editing Menu CPT where I input the data from the select from the glossary: image

Displaying the data from the select of the Menu CPT (pulling from glossary): I will need to display each instead of the text "Gluten, Ous"... image

So If the Glossary allows us to create media inputs we will be able to pull media based on a selected text from a select, radio...

pauserratgutierrez commented 1 year ago

@Crocoblock

pauserratgutierrez commented 1 year ago

I came across a tricky way to do it. We can write an image tag in the name field in the glossary with link of the png or jpg with src. It does not work with svg

rtpHarry commented 1 year ago

Just off the top of my head: For the trick, did you try looking at it in the inspector with the svg file - I think by default an svg image will default to 0x0 pixels and look like it wasn't working, but if you can set a size with css then it might work?