I am facing one issue and I am not sure if what i would like to do makes sense.
In fact I would like to set layout’s body onload from one particular view. In my approach onload should not be modified in case user is elsewhere than one view.
Do you know if it is possible at all?
Kind Regards,
You could do that with Route Context. You can add unique class for actions/action that you want the onload to be added on. And then use some javascript library depending on which class the body tag has.
Once you have body classes that are unique for various modules, controllers, and actions you can use those as part of your selectors in jQuery (or whatever JavaScript library you’re
using).
Ref: Route Context
Hope it helps