0

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?
1
  • You want to change the theme?
    – Amit Bera
    Commented Jan 25, 2019 at 8:01

1 Answer 1

0

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.

2
  • 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
    Commented Jan 25, 2019 at 8:20
  • Hold , i am checking
    – Amit Bera
    Commented Jan 25, 2019 at 8:20

Your Answer

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

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