I was wondering if it's possible to make changes to default.xml programmatically?

Use case is as follows:

  • I want a different theme being loaded when a certain mode is activated for example by clicking on a checkbox.
  • Or should I use a different approach?
  • You want to change the theme?
    – Amit Bera
    Jan 25, 2019 at 8:01

1 Answer 1


I guess you want to change theme basic of some condition.

Then, Do the below steps:

  • A dropdown on which each option will have URL mode respective theme id at its URL.URL will be like http//www.example.com/{frontenName}/{ControllerName}/{ActionName}/mode/{RespectivethemeCode}
  • Now at Action, you need to fetch mode parameter value and save the mode value to a Session Variable.

  • Last at controller dispatch event change theme based on the mode session variable.

  • Yeah yeah i got that you should do something like that, but what event should you let the controller dispatch? I Could not find any event which allows you to load a different theme..
    – Wokkel
    Jan 25, 2019 at 8:20
  • Hold , i am checking
    – Amit Bera
    Jan 25, 2019 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.