Jump to content

customize list.tpl and form.tpl in my MODULE


nozzula

Recommended Posts

Hi,

I'm developing a module for 1.5 that adds a new tab in the administration pages.

 

Here my class

class MyModuleController extends ModuleAdminController {

[...]

    public function init()
    {
        parent::init();

        [...]

        $this->fields_list = array(
            'myID' => array(
                'title' => $this->l('ID'),
                'align' => 'center',
                'width' => 30
            ),
           'myText' => array(
                'title' => $this->l('Status'),
                'align' =>'center',
                'width' => 90,
                'type' => 'select',
                'list' => $statusArray,
                'filter_key' => 's!id_status'
            )
        );
    }

    public function renderForm()
    {
         [...]

         $this->fields_form = array(
            'legend' => array(
                'title' => $this->l('myTitle'),
                'image' => '../modules/mymodule/img/logo.gif'
            ),
            'input' => array(
                array(
                    'type' => 'select',
                    'label' => $this->l('Customer'),
                    'name' => 'id_customer',
                    'default_value' => (int)$cust_select->id,
                    'options' => array(
                        'query' => $customers,
                        'id' => 'id_customer',
                        'name' => 'lastname'
                    ),
                ),
                array(
                    'type' => 'select',
                    'label' => $this->l('Status'),
                    'name' => 'id_status',
                    'default_value' => (int)$obj->id_status,
                    'hint' => $this->l('The status change automatically depending on customer s choice, modify it exceptionally!'),
                    'options' => array(
                        'query' => $status_lang,
                        'id' => 'id_status',
                        'name' => 'status_desc'
                    ),
                ),
         ),
            'submit' => array(
                'title' => $this->l('Save'),
                'class' => 'button'
            )
        );

        return parent::renderForm();
    }

}

I'd like to customize the (helpers) form.tpl and list.tpl and the form.tpl used in the module configuration page.

 

Which is the right path to place the custom tpl in my module dir?

I tried with

 

{prestashop-dir}\modules\{mymodule}\views\templates\admin\helpers\form\form.tpl

{prestashop-dir}/modules/{mymodule}/views/templates/admin/{controller}/helpers/form/form.tpl

 

but not work...

  • Like 1
Link to comment
Share on other sites

ok I created

 

{prestashop-dir}\modules\{mymodule-dir}\views\templates\admin\my_module\helpers\form\form.tpl

 

form.tpl contains:

{extends file="helpers/form/form.tpl"}

this is my custom text

but after the module installation still not work...what's wrong?

Link to comment
Share on other sites

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...