OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce How can I override the twig file that in import folder of the Bundle

This topic contains 2 replies, has 2 voices, and was last updated by  bihucn 5 years, 8 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
  • #33204

    bihucn
    Participant

    Hi everyone
    If I want to override the twig file that in import folder of the Bundle, how can I do it?
    Thanks!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #33205

    Andrey Yatsenko
    Moderator

    I guess you are talking about OroCommerce front-store layouts system.

    To override any template you need to create a layout update file (.yml file with actions: section) in the same folder inside Resources/views/layouts as the original template was added with @setBlockTheme or @setFormTheme instruction.

    Just add the same instruction @setBlockTheme or @setFormTheme with the relative path to a new twig template to your layout update.
    Notice: You can add to a new twig file only blocks you want to override, there is no need to copy the whole template.

    Layouts don’t relly on bundle inheritance but make sure your bundle was loaded after the bundle with original layout update to make your instructions in layout update file executed after the original one.

    To know more about OroCommerce layouts, please read the documentation:
    https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/LayoutBundle/README.md

    #33206

    bihucn
    Participant

    Thank you very much!

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

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

Back to top