Add new template and wrapper for featured products on home page

hello, i successfully displayed featured products on home page by instruction given in this link,

CS-Cart Documentation — CS-Cart 4.15.x documentation

but, i need to change design of that as per my requirements,

if i change that template's .tpl file directly, it will not affect everywhere in site when i called that block ?

so i want to create a new template and wrapper for that which i can set from admin for featured products ?

anyone have any idea about how to do that ?

Anyone Pleaseee…

Please check below screenshot, i want to add new template and wrapper type for featured block in Design → Blocks → HomePage

Please check below screenshot, i want to add new template and wrapper type for featured block in Design → Blocks → HomePage[attachment=5902:myscreen.png]

myscreen.png

[quote name='developer' timestamp='1349267113' post='146249']

hello, i successfully displayed featured products on home page by instruction given in this link,

http://kb.cs-cart.co…d-products-home

but, i need to change design of that as per my requirements,

if i change that template's .tpl file directly, it will not affect everywhere in site when i called that block ?

so i want to create a new template and wrapper for that which i can set from admin for featured products ?

anyone have any idea about how to do that ?

[/quote]



The wrapper files are here:
/skins/YOURSKIN/customer/blocks/wrappers


Changing wrappers is very easy. Simply copy one of the default template files, and replace with your content.



The template files are bit tricky.

You have to add some array to the
/schemas/block_manager/templates.php


and you have to place your unique template file to the skins directory. If you familiar with PHP and Smarty, you can do this very easily.

thanks for your help mate,

I copied a default products_multicolumns.tpl and made changes in


/schemas/block_manager/templates.php


i put below code exactly after products_multicolumns.tpl's code


'blocks/products/products_featured.tpl' => array (
'settings' => array(
'item_number' => array (
'type' => 'checkbox',
'default_value' => 'N'
),
'number_of_columns' => array (
'type' => 'input',
'default_value' => 2
)
),
'bulk_modifier' => array (
'fn_gather_additional_products_data' => array (
'products' => '#this',
'params' => array (
'get_icon' => true,
'get_detailed' => true,
'get_options' => false,
),
),
),
),


but now its displaying 2 options with same name in Template Dropdown as “Grid”.

how can i change that title ?

[quote name='developer' timestamp='1349273720' post='146264']

thanks for your help mate,

I copied a default products_multicolumns.tpl and made changes in


/schemas/block_manager/templates.php


i put below code exactly after products_multicolumns.tpl's code


'blocks/products/products_featured.tpl' => array (
'settings' => array(
'item_number' => array (
'type' => 'checkbox',
'default_value' => 'N'
),
'number_of_columns' => array (
'type' => 'input',
'default_value' => 2
)
),
'bulk_modifier' => array (
'fn_gather_additional_products_data' => array (
'products' => '#this',
'params' => array (
'get_icon' => true,
'get_detailed' => true,
'get_options' => false,
),
),
),
),


but now its displaying 2 options with same name in Template Dropdown as “Grid”.

how can i change that title ?

[/quote]



In your template file, you have a block description in the first line like this:
{** block-description:products_grid **}


Change the name to eg. “featured_products”

{** block-description:featured_products **}

I am not sure, but I think, this will resolve your issue.

Thank you very very much, it worked :grin:

[quote name=‘developer’ timestamp=‘1349277305’ post=‘146269’]

Thank you very very much, it worked :grin:

[/quote]

You are welcome. (Reputation points will be appreciated ;])