I created a new custom template in /design/themes/basic/templates/blocks/list_templates,
and how to make it can be chosen in the backend > Design >Layouts > Manage blocks >Block's template?
Hi @atlaswu,
You need to add tp, into the folder ```php
design/themes/[THEME_NAME]/templates/addons/my_changes/blocks/products/custom_template.tpl
<br />
I hope that helps,<br />
<br />
---<br />
Valentin<br />
[color=#808080][size=2]part of hungryweb.net[/size][/color]
Hi Vail, thanks for your advice, this is what I am looking for.
Another question, how could I creat new custom template in “templates/blocks/products/”. Though I can creat or duplicate new, and rename the {** block-description: xxx**}, to make the template show in “block manager/Editing block” in Backend. But if the new name is not same as the originals in the templates/blocks/products/ (ex: “products_small_items.tpl” duplicated and renamed as “products_small_items2.tpl” ) though I can see the content of block in front-store, but it has no product pictures showed?
[quote name='atlaswu' timestamp='1405784927' post='187845']
Hi Vail, thanks for your advice, this is what I am looking for.
Another question, how could I creat new custom template in “templates/blocks/products/”. Though I can creat or duplicate new, and rename the {** block-description: xxx**}, to make the template show in “block manager/Editing block” in Backend. But if the new name is not same as the originals in the templates/blocks/products/ (ex: “products_small_items.tpl” duplicated and renamed as “products_small_items2.tpl” ) though I can see the content of block in front-store, but it has no product pictures showed?
[/quote]
You should create the file
app/addons/my_changes/schemas/block_manager/templates.post.php
with the following content:
```php
$schema ['design/themes/[THEME_NAME]/templates/addons/my_changes/blocks/products/products_small_items2.tpl'] = array (
'settings' => array(
'item_number' => array (
'type' => 'checkbox',
'default_value' => 'N'
)
),
'bulk_modifier' => array (
'fn_gather_additional_products_data' => array (
'products' => '#this',
'params' => array (
'get_icon' => true,
'get_detailed' => true,
'get_options' => true,
),
),
),
);
return $schema; ```
Hope that helps.
If is not working you can try to
#replace $schema ['design/themes/[THEME_NAME]/templates/addons/my_changes/blocks/products/products_small_items2.tpl'] = array (
#with $schema ['addons/my_changes/blocks/products/products_small_items2.tpl'] = array (
I hope that helps,
—
Valentin
[color=#808080][size=2]part of hungryweb.net[/size][/color]
I am not understand how to using my_changes well.
I created a templates.post.php as the code (does it need the php close tag “?>”?)
then a duplicated the “[color=#282828][font=arial, verdana, tahoma, sans-serif]products_small_items2.tpl” from “[/font][/color]products_small_items.tpl” at[color=#282828][font=arial, verdana, tahoma, sans-serif] [/font][/color]addons/my_changes/blocks/products.
{** block-description:small_items_2 **}
{if $block.properties.hide_add_to_cart_button == "Y"}
{assign var="_show_add_to_cart" value=false}
{else}
{assign var="_show_add_to_cart" value=true}
{/if}
{assign var="_show_name" value="true"}
{include file="addons/my_changes/blocks/list_templates/slick-8.tpl"
products=$items
obj_prefix="`$block.block_id`000"
item_number=$block.properties.item_number
show_name=$_show_name
show_trunc_name=$_show_trunc_name
show_price=true
show_add_to_cart=$_show_add_to_cart
show_list_buttons=false
add_to_cart_meta="text-button-add"
but_role="text"}
I still can not get the poduct's image showed.
Please specify the location of the products_small_items2.tpl file
I tried both
“design/themes/[myTHEME]/templates/addons/my_changes/blocks/products/products_small_items2.tpl”
and
“addons/my_changes/blocks/products/products_small_items2.tpl”
the title and price listed correct, but no image only.
[quote name='atlaswu' timestamp='1406200954' post='188136']
I tried both
“design/themes/[myTHEME]/templates/addons/my_changes/blocks/products/products_small_items2.tpl”
and
“addons/my_changes/blocks/products/products_small_items2.tpl”
the title and price listed correct, but no image only.
[/quote]
It depends on the current location of your template. The file should be located here:
design/themes/[THEME_NAME]/templates/addons/my_changes/blocks/products/products_small_items2.tpl
and the php string should be:
...
$schema ['addons/my_changes/blocks/products/products_small_items2.tpl'] = array(
...
And do not forget to clear the cache
Thanks
I’ve been trying to use this example to create a copy of the ‘My account’ block but I can’t get it to work.
I want to add a copy of that block to the top of the page but be able to edit the copy of the template so I
can add the necessary login, register and change password links of the support system.
Here’s what I currently have:
Below is what I want (both will have a drop down menu but the ‘My Support Account’ drop down menu will have custom links):
Is this possible? Can one of you tell me what I need to do?
Thanks,
Jeff
As a start point we can offer you to create a copy of the design/themes/THENE/templates/blocks/my_account.tpl file in the design/themes/THENE/templates/blocks/static_blocks directory. Then clear a cache and create a new block, use the Template item and you will see My account template there
Thank you! That worked.
I simply had to move my copied template to 'skins\basic\customer\addons\my_changes\blocks[b]static_templates[/b]'.
[quote name='jeffshead' timestamp='1412331572' post='193330']
Thank you! That worked.
I simply had to move my copied template to 'skins\basic\customer\addons\my_changes\blocks[b]static_templates[/b]'.
[/quote]
We glad to hear that our solution helped you.