thepixturethepixture MemberComments: 2 Received thanks: 0 Member since: April 2017

Based on the element "Product-Box" I created my own element and the corresponding storefront-template. I only changed the names in the index.js.

In the backend, the data of the selected product is also correctly displayed and stored. But in the frontend I do not see any product. If I dump() the data in the storefront-template, the value data = null.

With the default product box element it works fine.

Does anybody have an idea what could be the reason for this?

Comments

  • ralfhralfh MemberComments: 20 Received thanks: 0 Member since: February 2020

    I have the same problem at a custom text element. I copied the original text element to my extension. It's working fine at the backend, but at the frontend element.data is null. But in translated -> config -> content -> value, there is my string. The original template uses {{ element.data.content|raw }} for the output which is null.

  • thepixturethepixture MemberComments: 2 Received thanks: 0 Member since: April 2017

    Have you tried { element.config.content.value|raw } for your text element? This is how i did it for my text element.

    If i'll do this for the product box i only get a hash value.

  • ralfhralfh MemberComments: 20 Received thanks: 0 Member since: February 2020

    Yes, that's working, but I don't know if it's the "right" way. I will use that for the moment.

  • VladislavVladislav MemberComments: 3 Received thanks: 0 Member since: April 2020

    up,

    this var is empty in the product box element, how can I receive data from the product?

  • petra_ppetra_p MemberComments: 13 Received thanks: 0 Member since: August 2020

    I have the same problem!

  • halfpint_utopiahalfpint_utopia MemberComments: 7 Received thanks: 0 Member since: October 2020

    Did anyone find a solution? Please share, as I am stuck on the same problem. Thanks

  • Tom_EarlyTom_Early MemberComments: 2 Received thanks: 0 Member since: December 2020

    Hello,

    I am having the same issue. Does anyone have an answer?

    Thanks,

    Tom

  • halfpint_utopiahalfpint_utopia MemberComments: 7 Received thanks: 0 Member since: October 2020
  • Tom_EarlyTom_Early MemberComments: 2 Received thanks: 0 Member since: December 2020

    Awesome. Where do I put that file? Thanks,  Tom

  • halfpint_utopiahalfpint_utopia MemberComments: 7 Received thanks: 0 Member since: October 2020

    I searched the platform for instances of AbstractCmsElementResolver and then mirrored the location in my plugin. So I added it to Plugin/src/Core/Content/Media/Cms/Type and used the namespace Plugin\Core\Content\Media\Cms\Type. I then added the service to my Plugin/src/Resources/config/services.xml.

    I am not 100% about why this works, nor why I need to create a DataResolver, or if this applies only to when I copy an element, as when I created a new custom element I did not have to create a resolver. If anyone has an answer to this, that would be great Halo

Sign In or Register to comment.