OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform How to render oro_attachment files?

This topic contains 3 replies, has 2 voices, and was last updated by  zebimax 6 years, 4 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #37080

    hariharasudhan
    Participant

    Hello All,

    I am new oroplatform, i have created the custom entity related many to one with oro_attachment_file.
    migrations looks like follow

    It stores the file correctly but i am not sure how to render this in image tag,if i tried

    I am getting error like An exception has been thrown during the rendering of a template ("Parameter "height" for route "oro_resize_attachment" must match "\d+" ("" given) to generate a corresponding URL.") how i can resolve this issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #37081

    zebimax
    Participant

    Hi, looks like you missed with method name of AttachmentExtension – you call addFileRelation, while it’s signature has 5 parameters. Probably your method is addImageRelation

    #37082

    hariharasudhan
    Participant

    Hi, I need the file relation, because user can upload image as well as video.

    #37083

    zebimax
    Participant

    Then, you can try to set width and height as attachment options when creating relation:

    But I am not sure you will not face some issues when using oro_configured_image_url twig function as you are using it in the not regular way)

Viewing 3 replies - 1 through 3 (of 3 total)

The forum ‘OroPlatform’ is closed to new topics and replies.

Back to top