elham_K Posted September 1, 2014 Share Posted September 1, 2014 Hi everyone, I created a new admin controller in prestashop, I used helperlist but view of my admin page is distorted. ----------------------------------------------------------------------------------------------------------- I've followed these steps : 1. - I created /controllers/admin/AdminResellersreqController.php like so:class AdminResellersControllerCore extends AdminController{}2. I created /classes/Resellersreq.php likeclass ResellersreqCore extends ObjectModel{} 3. I created ps_resellers_req table -------------------------------------------------------------------------------------------------- this is my admincontroller code : class AdminResellersreqControllerCore extends AdminController { public function initProcess() { $this->id_object = Tools::getValue('id_'.$this->table); if (Tools::isSubmit('changeStatus') && $this->id_object) $this->action = 'change_status'; parent::initProcess(); } public function __construct() { $this->table = 'resellers_req'; $this->className = 'Resellersreq'; $this->lang = false; $this->fields_list = array( 'req_date' => array( 'type' => 'date', 'title' => $this->l('Request Date'), 'width' => 'auto' ), 'description' => array( 'title' => $this->l('Description'), 'width' => 'auto' ), 'status' => array( 'title' => $this->l('Status'), 'type' => 'bool', 'width' => 'auto' ), 'id_customer' => array( 'title' => $this->l('Edit Group'), // 'type' => 'text', 'callback' =>'ShowCustomerGroupLink', 'width' => 'auto' ), ); parent::__construct(); } // This method generates the list of results public function renderList() { $this->simple_header = true; return parent::renderList(); } }------------------------------------------------------------------------------------------------------ But the view of my admin page haven't any css!! could anyone help me? view of may admin page controller : controllerpage.bmp Link to comment Share on other sites More sharing options...
elham_K Posted September 1, 2014 Author Share Posted September 1, 2014 (edited) Hi everyone, I created a new admin controller in prestashop, I used helperlist but view of my admin page is distorted. ----------------------------------------------------------------------------------------------------------- I've followed these steps : 1. - I created /controllers/admin/AdminResellersreqController.php like so: class AdminResellersControllerCore extends AdminController{} 2. I created /classes/Resellersreq.php like class ResellersreqCore extends ObjectModel{} 3. I created ps_resellers_req table -------------------------------------------------------------------------------------------------- this is my admincontroller code : class AdminResellersreqControllerCore extends AdminController { public function initProcess() { $this->id_object = Tools::getValue('id_'.$this->table); if (Tools::isSubmit('changeStatus') && $this->id_object) $this->action = 'change_status'; parent::initProcess(); } public function __construct() { $this->table = 'resellers_req'; $this->className = 'Resellersreq'; $this->lang = false; $this->fields_list = array( 'req_date' => array( 'type' => 'date', 'title' => $this->l('Request Date'), 'width' => 'auto' ), 'description' => array( 'title' => $this->l('Description'), 'width' => 'auto' ), 'status' => array( 'title' => $this->l('Status'), 'type' => 'bool', 'width' => 'auto' ), 'id_customer' => array( 'title' => $this->l('Edit Group'), // 'type' => 'text', 'callback' =>'ShowCustomerGroupLink', 'width' => 'auto' ), ); parent::__construct(); } // This method generates the list of results public function renderList() { $this->simple_header = true; return parent::renderList(); } } ------------------------------------------------------------------------------------------------------ But the view of my admin page haven't any css!! could anyone help me? view of may admin page controller : controllerpage.JPG I found out that in html code of my admin controller page the class of div with content id is nobootstrap <div id="content" class="nobootstrap" > but in another admin controllers like adminproduct controller the class of div with content id is bootstrap <div id="content" class="nobootstrap" > where can I change this class? in which file or how? could anyone help me please? Edited September 1, 2014 by elham_K (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted September 1, 2014 Share Posted September 1, 2014 in your __construct function use $this->bootstrap = true; and add this: public function hookActionAdminControllerSetMedia($params) { if ($this->context->controller->controller_name == 'YourAdminController' $this->context->controller->addCSS(($this->_path) . 'css/your_admin.css'); } } 1 Link to comment Share on other sites More sharing options...
Creativus Comunico Posted March 17, 2016 Share Posted March 17, 2016 (edited) Hello, I actually have the same problem. In my moduleAdminController I set $this->bootstrap = true; I also resgistered new hook to my module - hookActionAdminControllerSetMedia - and the adequate function to add JS & CSS resources. I uninstalled and reinstalled and both files are loaded. But template loaded is still noboostrap...? Has someone an idea please ? I of course managed to do it through JS by changing class of div #content but it doesn't appear to me as a 'clean' solution... Alexandre Edited March 17, 2016 by Creativus Comunico (see edit history) Link to comment Share on other sites More sharing options...
nicknic92 Posted June 21, 2016 Share Posted June 21, 2016 i have the same problem too , could anyone help? thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now