Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pimcore_image() attributes ignored #8600

Closed
valentin- opened this issue Mar 30, 2021 · 1 comment
Closed

pimcore_image() attributes ignored #8600

valentin- opened this issue Mar 30, 2021 · 1 comment

Comments

@valentin-
Copy link
Contributor

Bug Report

Expected behavior

Pass attributes to pimcore_image() or image.thumbnail('size').html({}) in twig as described in https://pimcore.com/docs/pimcore/master/Development_Documentation/Documents/Editables/Image.html#page_An-Example-Using-Custom-Attributes.

Actual behavior

Passed attributes are not present in the html output.

Steps to reproduce

Create an image editable with attributes:

{{ pimcore_image('image', {
    thumbnail: image_size,
    attributes: {
        'custom-attr': 'value',
        'data-role': 'image',
    }
}) }}

Or directly output the image thumbnail:

{{ image.thumbnail(image_size).html({
    'class': 'my-class',
    'data-test': '123',
}) }}

Version: dev-master|1ba3830f59c407400f99aa21d3cb56db816775da

@dvesh3 dvesh3 added the Bug label Mar 30, 2021
@dvesh3 dvesh3 added this to the 10.0.0 ("Pimcore X") milestone Mar 30, 2021
@dvesh3
Copy link
Contributor

dvesh3 commented Mar 30, 2021

@valentin- you should pass imgAttributes or pictureAttributes to thumbnail html() please see https://pimcore.com/docs/pimcore/master/Development_Documentation/Assets/Working_with_Thumbnails/Image_Thumbnails.html#page_Advanced-Examples

anyway example should be removed from the docs. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants