React on selected layout in pages module
Hi,
I have extendet the page module with 2 fields. Now I want to display the labels according to the selected layout.
Is there a possibility to get the currently selected value in the form_fields method of the my_pages_model? Or is there another method I can overload to save the value in a global var?
Comments
function form_fields($values = array()) { $fields = parent::form_fields(); ... }
so then I have both fields and values to work withthat doesn't work. I think it is just javascript on changing the layout select value...
http://docs.getfuelcms.com/modules/simple#overwrites
$config['module_overwrites']['pages']['js_controller'] = 'MyPageController'; $config['module_overwrites']['pages']['js_controller_path'] = js_path();
This will look for a javascript file in the assets/js/MyPageController.js
$config['module_overwrites']['pages']['js_controller_path'] = BASE_URL.'assets/js/', $config['module_overwrites']['pages']['js_controller'] = 'fuel.controller.MyPageController';
works better.
Where the .js file is in /assets/js/fuel/controller.