Jump to content

2 questions, Size for thumbs and Tab page

Recommended Posts

Hello, i hope somebody can help me, since i cannot find any information regarding this issues.

1). I'm creating a module and i have an file type field and a thumb for that field like this:

                    'type' => 'file',
                    'label' => $this->l('Image file'),
                    'name' => 'MODALAGEVERIFY_IMGMODAL',
                    'display_image' => true,
            		'thumb' => '../upload/'.Configuration::get('MODALAGEVERIFY_IMGMODAL'),
                    'hint' => $this->l('allowed file types : .gif, .jpg, .png'),
					'desc' => $this->l('Upload an image file for your modal (only if "Modal Image only" is enabled)'),


This works fine, the problem is that if i upload a large image it displays it in full size, i would like to know how to change the thumb size.


2. The other question is that i'm trying to add tabs to my configuration page, like those tabs you see for "General Setting" "Colors" and that kind of thing.

I couldn't find anything in this regard so i looked up in AdminThemesController and found this:

$this->fields_options = array(
            'appearance' => array(
                'title' => $this->trans('Your current theme', array(), 'Admin.Design.Feature'),
                'icon' => 'icon-html5',
                'tabs' => array(
                    'logo' => $this->trans('Logo', array(), 'Admin.Global'),
                    'logo2' => $this->trans('Invoice & Email Logos', array(), 'Admin.Design.Feature'),
                    'icons' => $this->trans('Favicons', array(), 'Admin.Design.Feature'),
                'fields' => array(
                    'PS_LOGO' => array(
                        'title' => $this->trans('Header logo', array(), 'Admin.Design.Feature'),
                        'hint' => $this->trans('Will appear on main page. Recommended size for the default theme: height %height% and width %width%.',
                                '%height%' => '40px',
                                '%width%' => '200px'
                        'type' => 'file',
                        'name' => 'PS_LOGO',
                        'tab' => 'logo',
                        'thumb' => _PS_IMG_.Configuration::get('PS_LOGO')

I tried to fit that into my code, but nothing happens, i mean nothing gets displayed, i looked around my code and notices i'm not using the renderForm function, i'm using the displayForm function as i saw this was the correct thing to do in the Prestashop official guide for making a module. 


So, my question right now is, How can i fix those two things, or can somebody point me in the right direction? 


Thank you

Share this post

Link to post
Share on other sites

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More