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

Custom components don't display previews #9

Open
AdrianSanduleasa opened this issue Oct 24, 2022 · 3 comments
Open

Custom components don't display previews #9

AdrianSanduleasa opened this issue Oct 24, 2022 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@AdrianSanduleasa
Copy link

Describe the bug
Custom components don't have a preview on 2.4.5-p1.

To Reproduce
Steps to reproduce the behavior:

  1. Create a custom component
  2. Go to Admin -> Content -> Blocks
  3. Click on Add New Block
  4. Scroll down to the content area and edit using Page Builder. Add a new row and inside that row, drag the newly created component which by default is "My Custom Type".
  5. You will notice that there is no preview content. The following content is not present in the preview:
    <div class="my-class" attr="data.my_element.attributes" data-bind="liveEdit: { field: 'my_field', placeholder: $t('Your custom content type!') }"></div>

Expected behavior
Preview for custom components should be displayed.

Screenshots
Screenshot 2022-10-24 at 16 05 29

@AdrianSanduleasa
Copy link
Author

AdrianSanduleasa commented Oct 24, 2022

It seems that the issue is coming from app/code/VendorName/MyCustomType/view/adminhtml/web/template/content-type/vendorname-mycustomtype/default/preview.html:2 from the selfclosing tag.
So in order to fix the preview, this:
<render args="getOptions().template"/>
Becomes this:
<render args="getOptions().template"></render>

@bdenham bdenham added help wanted Extra attention is needed bug Something isn't working labels Apr 26, 2024
@bdenham
Copy link
Collaborator

bdenham commented Apr 26, 2024

This seems like an easy enough fix and it looks familiar. Was there a PR already merged that fixed this?

@bdenham
Copy link
Collaborator

bdenham commented Apr 26, 2024

@AdrianSanduleasa ^^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants