Is this the best way to turn off block caching for a specific custom block:-
In File:-
schemas/block_manager/block_cache_properties.php
'data_functions' =>array (
'STATIC_TEMPLATE_BLOCK' => array (
'templates' => array (
Add new entry at end of array list:-
'blocks/mini_cart.tpl' => array (
'disable_cache' => true,
),
This is to allow the mini cart in a block, without this results in abnormal mini cart due to block caching.
I would do it with my_changes/schemas/block_manager/block_cache_properties.post.php and then just add the one element you want to add to the existing (previously defined) data structure.
Then it will be there when you upgrade and you won't have a conflict.
Thanks for the reply.
Could not find any hook in block_cache_properties.php
It's not a hook, it's an extension of the schema.
I created the /addons/my_changes/schemas/block_manager/block_cache_properties.post.php file to disable the categories from being cached due to a specific javascript issue. Here's the contents of that file:
```php
'data_functions' =>array (
'_STATIC_TEMPLATE_BLOCK_' => array (
'templates' => array (
'blocks/categories_emenu.tpl' => array (
'disable_cache' => true,
),
),
),
),
);
?>
```
When I clear the store cache and load home page, I get an error:
Warning: array_unique() [function.array-unique]: The argument should be an array in /home/realtree/public_html/store/core/templater_plugins/function.block.php on line 262
Warning: Invalid argument supplied for foreach() in /home/realtree/public_html/store/core/cache/class.cache_backend_file.php on line 47
Any idea what's going on?
As a test, I moved that same code to schemas/block_manager/block_cache_properties.php, and there were no errors. However, my categories are still being cached. I tried to disable caching for:[list]
[]blocks/categories_emenu.tpl
[]views/categories/components/menu_items.tpl
[/list]
I doubt you want to set $schema = to the array info. This would negate any other addons that may have added to the schema.
You probably want it to be something like:
```php
array (
'disable_cache' => true,
);
?>
```
This will ensure that you are onlly assigning to the property you want to change.
Makes sense. I moved the code back to [color=#282828][font=arial, verdana, tahoma, sans-serif]/addons/my_changes/schemas/block_manager/block_cache_properties.post.php and cleared the template cache. There aren't any errors, but the categories are still being cached.[/font][/color]