Jump to content

Pswidget (Customhtml)


j4ck

Recommended Posts

Hi, just start with prestashop.

 

Currently adapting my first module, named "PSWidget".

 

Module adds smarty function {pswidget} + custom html renderer.

 

Module description:

 

0. Install pswidget module

1. Navigate to Preferences - PSWidget

2. Add new pswidget item with name (i.e. "test") and text field filled

3. Modify your whatever-template.tpl, adding pswidget call

{pswidget action="text" id="test" cache=300}

4. Refresh page to see changes

 

Draft code available:

https://github.com/rustyJ4ck/pswidget/

 

 

 

Has some questions:

 

1. pswidget-form.png

 

How to change default selected value for radios: from No to Yes?

 

			array(
				'type' => 'radio',
				'label' => $this->l('Raw:'),
				'name' => 'raw',
				'required' => false,
				'is_bool' => true,
				'class' => 't',
				'values' => array(
					array(
						'id' => 'pswidget-b-2',
						'value' => 1,
						'label' => $this->l('Yes')
					),
					array(
						'id' => 'pswidget-b-2',
						'value' => 0,
						'label' => $this->l('No')
					)
				)
			),	  

 

2. How to implemet instant checkbox change in list view (like active=status)

 

		'plain' => array(
			'type'	  => 'bool',
			'title'	 => $this->module->l('plain'),
			'width'	 => 40,
			'align'	 => 'center',
//?			 'callback' => 'printPlainIcon'
		),					  

Thx.

Edited by j4ck (see edit history)
Link to comment
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...