Creating A Block .tpl File

I'm re-skinning multivendor, so I cloned the default responsive theme.

I can see that the theme has a folder called "templates/blocks/static_templates" which has a list of blocks that can be used in the admin.

My question is, can I create my own block/tpl file in this folder and use it in the admin?

and How?

Thanks

Hi,

Is better to create in the my_changes add-on folder

design/themes/[THEME_NAME]/templates/addons/my_changes/blocks/static_templates/[NEW_BLOCK_NAME].tpl
  • "My Changes" add-on needs to be active
  • You can create as much files you need
  • If the category structure is missing you need to create

I hope that helps,

---
Valentin
part of hungryweb.net

Thanks vali, I want to try that but yesterday I uninstalled my_changes from the admin.

Any idea how to install it again? Thanks

I managed to re-install the my_changes add on, and I reactivated it.

I also followed your steps but I couldn't see the block I created in the admin!

Any idea?

Did you clear cache?

The issue is in cache (system, not templates one). Just add &cc&ctpl to the URL in the admin panel. E.g.

http://your_domain.com/your_admin.php?cc&ctpl

Also please note that the new block can be found in the list of templates of the block with the Template type

http://prntscr.com/agavb1

No luck guys, I did all that with no luck.

Here is what I did exactly:

1- I copied "design\themes\mytheme\templates\blocks\static_templates\logo.tpl" TO "design\themes\mytheme\templates\addons\my_changes\blocks\static_templates\mylogo.tpl"

2- I changed the first line in mylogo.top FROM

{** block-description:tmpl_logo **}

TO

{** block-description:tmpl_mylogo **}

3- I made sure the my changes addon is active in the admin

4- I cleared cache as suggested

http://localhost:8080/w/multivendor/admin.php?dispatch=block_manager.manage&cc&ctpl

5- I also deleted all the files from "var\cache\templates\mytheme"

6- I went to admin > design > layouts and tried to add a block but didn't see my new block in the list of available blocks!

{** block-description:tmpl_logo **}

means that this template will be named tmpl_logo an you should see 2 layout of "Logo" in the list ;) please remove that code and you should find the template named

_mylogo

and if you want to add a name to this template you just go to Language > Variables and add this value

name=mylogo

valu=My Logo

Thanks vali but it didn't work! This is driving me crazy.

Please make sure that the My changes module is installed and active. I have just created several static blocks for one project without any issues.

It is installed and active.

I'm on the trial mode of multivendor but it is not expired yet. Could that be the issue??

Thanks

...

6- I went to admin > design > layouts and tried to add a block but didn't see my new block in the list of available blocks!

You should find it here:

1. Add new block

2. Select the new block

Content of the file mylogo.tpl should not include {** block-description:tmpl_logo **} because than you you find in list two templates of Store logo

Please check before adding the block

  • My Changes add-on is active
  • You add mylogo.tpl into the active theme
  • Clear cache

If the Vali's answer does not help you, please PM me temporary FTP access so that we can check the issue. Trial version cannot be the reason

Vali, thank you very much it works. I didn't know about clicking the "Template" icons.

Thank you everyone for help :)

It was mentioned in my post #6. :) Anyway, we are glad to hear that the issue is solved. Have a great weekend!

Any help is welcomed!
How to add a custom block that is visible in a product tab for cs cart 4.19.1?
where to place the .tpl to be visible displayed in template selector (drop down) for creating new block?
I added prices_tab.tpl in
/home/mysite/dev.mydomain.ro/design/themes/responsive/templates/blocks/product_tabs and the tab is visible in backend but is not visible in front end.
I didn clear the cache no results.

Didn t get how to link a product tab with a block that doesn t have a template visible in selector or needs to be visible in selector?

Try to reinstall the module. In this case new tab should be added to the Product tabs section

Is not about a specific module. I need to know how to do this for any module with version 4.19.1. I have a different module that you could think of

The product tabs from addons are stored in the database. At first you should create the file for product tabs and install the module then. In this case it will be automatically added to the database. This applies to all addons

The path to the template should be saved in table “cscart_product_tabs”?
as example:
addons/my_custom_addon/blocks/product_tabs/my_custom_addon.tpl?

Do I need to Add Block → HTML block with Smarty and in the content to place path to
.tpl file
{include file=“addons/my_custom_addon/blocks/product_tabs/my_custom_addon.tpl”}?
This will make tab to be visible in product page?

There ia also a option to create the link between .tpl and block from addon not to create manually?