gantry / gantry5

:rocket: Next Generation Template / Theme Framework
http://gantry.org
1.03k stars 205 forks source link

Lable image #2951

Closed Alex-Indilex closed 2 years ago

Alex-Indilex commented 2 years ago
yaml
_tab_content:
          label: Content
          fields:
            image:
              type: input.imagepicker
              label: Image
              description: An image field with an image picker.
              placeholder: Pick an image
            image_lable:
              type: input.imagepicker
              label: Image Label
              description: An image field with an image picker.
              placeholder: Pick an image

html.yaml
<img{{popover_image_width|raw}}{{popover_image_height|raw}} src="{{ url(particle.image)|e }}" alt="{{ particle.image_alt|e }}" class="">
 <img src="{{ url(particle.image_label)|e }}" alt="img" class="image-label">

Please help. Uploading a picture to the label field, but it doesn't display. The picture link is not generated

pmoreno-rodriguez commented 2 years ago

You are calling the label with the name of image_label. In your blueprint file put image_lable.

Alex-Indilex commented 2 years ago

Can you tell me which file? I don't have one

pmoreno-rodriguez commented 2 years ago

Can you show me the files structure of your theme? Or can you show me the website which this happens?

Alex-Indilex commented 2 years ago

http://new.indilex.ru/index.php/products/weatherproof-acoustics

For example, the label should be displayed on this page, but now it's just space. I uploaded the picture through the form in the particle. stru

pmoreno-rodriguez commented 2 years ago

Ok. I see you are using the Gantry Framework. Well, you have to got to custom/particles and modify jlpopover.yaml file, the following line:

image_lable: type: input.imagepicker label: Image Label description: An image field with an image picker. placeholder: Pick an image

You have an error in image_label. (lable instead label)

Alex-Indilex commented 2 years ago

My God... Thank you so much

mahagr commented 2 years ago

I would fix the variable name.. but.. it would break overrides. So I'll leave it like this.

Alex-Indilex commented 2 years ago

this works, but we need to make a condition that if the picture badge is not uploaded, it does not display

image_badge: type: input.imagepicker label: Image badge description: An image field with an image picker. placeholder: Pick an image

mahagr commented 2 years ago

You can use Twig to do that. See the docs https://twig.symfony.com/doc/1.x/