How To: Add auto-size product tab on V3.0

SQL


<br />
ALTER TABLE `cscart_product_tabs` ADD `auto_width` CHAR(1) NOT NULL default 'N' AFTER `template`;<br />

```<br />
<br />
Open tpl = skins/basic/admin/views/tabs7update.tpl<br />
after<br />
```php
<br />
<div class="form-field"><br />
	 <label for="show_in_popup_{$html_id}">{$lang.show_tab_in_popup}:</label><br />
	 <input type="hidden" name="tab_data[show_in_popup]" value="N" /><input type="checkbox" name="tab_data[show_in_popup]" id="show_in_popup_{$html_id}" {if $tab_data.show_in_popup == "Y"}checked="checked"{/if} value="Y" class="checkbox"/><br />
	</div>  <br />

```<br />
<br />
put this<br />
```php
<br />
				<div class="form-field"><br />
	 <label for="auto_width_{$html_id}">{$lang.auto_width}:</label><br />
	 <input type="hidden" name="tab_data[auto_width]" value="N" /><input type="checkbox" name="tab_data[auto_width]" id="auto_width_{$html_id}" {if $tab_data.auto_width == "Y"}checked="checked"{/if} value="Y" class="checkbox"/><br />
	</div><br />

```<br />
<br />
open tpl.= skins/basic/customer/views/tabs/components/product_popup_tabs.tpl<br />
<br />
replace the class in line 17 with this class<br />
```php
<br />
class="cm-dialog-opener{if $tab.auto_width == "Y"} cm-dialog-auto-width{/if}"<br />

```<br />
<br />
<br />
Finish and have fun with the the new auto-sized function in cs 3 <img src="upload://rA9Qa8gnUPZzRZRdI8kt3dpjkrs.png" class="bbc_emoticon" alt=":)">

can you show screen shot i dont understand what it does.

Normaly the Produkt tabs will show in the maximum width.

But if you have



my code will call the auto-width from the core.js

see example:

1: Without auto-width

2: with auto-width

Unbenannt1.PNG

with-auto-width.PNG

nice!



John

That is impressive. Thank you for a prompt solution!