8000 [Documents] Image editable - fix missing alt & title in frontend by ramundomario · Pull Request #10670 · pimcore/pimcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Documents] Image editable - fix missing alt & title in frontend #10670

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

Merged

Conversation

ramundomario
Copy link
Contributor

Changes in this pull request

Regression of #7661

Steps to reproduce

  • Set alt value in editmode for image editable
  • Alt & title attributes are empty when image is displayed in frontend

@dvesh3 dvesh3 added the Bug label Oct 22, 2021
@dvesh3 dvesh3 added this to the 10.2.3 milestone Oct 22, 2021
@dvesh3
Copy link
Contributor
dvesh3 commented Oct 25, 2021

Sorry, not able to reproduce the issue. please pass image attributes as below:

{{ pimcore_image('pimcore-image',
    {
        thumbnail: 'content',
        imgAttributes: {
            title: 'title text',
            alt: 'alt text'
        }
    }) }}

@dvesh3 dvesh3 closed this Oct 25, 2021
@ramundomario
Copy link
Contributor Author
ramundomario commented Oct 25, 2021

@dvesh3
Issue refers to the value entered in editmode which should be printed by default if it is not specified when printing the editable:
{{ pimcore_image('pimcore-image') }}

Please see this example reproduced on demo:
Oc5pE5pgzX

@dvesh3 dvesh3 reopened this Oct 25, 2021
@dvesh3
Copy link
Contributor
dvesh3 commented Oct 25, 2021

@ramundomario sorry, misunderstood the steps. It makes sense 👍

@ramundomario
Copy link
Contributor Author
ramundomario commented Oct 25, 2021

@dvesh3
Don't worry 👍
BTW: We should also handle alt and title passed via code as in your example.
Who should take precedence? The value entered in editmode or the one in the code?

@dvesh3
Copy link
Contributor
dvesh3 commented Oct 25, 2021

BTW: We should also handle alt and title passed via code as in your example.
Who` should take precedence? The value entered in editmode or the one in the code?

yes, true. I would say editmode takes the precedence since it is set by document author and the one defined in the code is used as a fallback.

@ramundomario
Copy link
Contributor Author

BTW: We should also handle alt and title passed via code as in your example.
Who` should take precedence? The value entered in editmode or the one in the code?

yes, true. I would say editmode takes the precedence since it is set by document author and the one defined in the code is used as a fallback.

Updated as discussed!
Note: used !empty(...) instead ?? since alt & text from editmode are empty string instead null.

@dvesh3 dvesh3 merged commit 3795582 into pimcore:10.2 Oct 27, 2021
@dvesh3
Copy link
Contributor
dvesh3 commented Oct 27, 2021

@ramundomario thanks a lot!

@ramundomario ramundomario deleted the bugfix/missing-alt-title-image-editable branch October 27, 2021 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0