| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 Block cache alter 2 ------------------------ 3 Requires Drupal 6 4 5 Author: Kristof De Jaeger - http://drupal.org/user/107403 6 Sponsored by One Agency - http://www.one-agency.be 7 8 Overview: 9 -------- 10 Alter cache settings per block. Cache settings per block are now set in code, 11 but if you don't like the default - usually none - you can now easily change this 12 per block on the block configuration page in a fieldset called 'Caching settings'. 13 Install this to speed up block rendering for authenticated users. 14 15 The module also comes with 2 core patches you can apply to the block module 16 which will make block caching much smarter. You'll be able to set expire times 17 for block based and cache clearing on actions (nodeapi, comment and user). 18 For those who don't like applying patches, you can also use a complete 19 patched version of block.module that comes with this module. 20 All patches and module files can be found in the patches directory. 21 22 1: blockcache_alter_with_node_grants.patch / block_with_node_grants.module 23 Most users should use this one. 24 25 2: blockcache_alter_no_node_grants.patch / block_no_node_grants.module 26 Experienced users can use this one if one of your installed modules is implementing 27 a node_grants hook. Drupal checks on this and whenever 1 or more hooks are found 28 block caching is disabled completely. Handle with care though, this might 29 cause problems, be sure to test your site completely if you apply this patch. 30 31 Note: you can run this module *without* applying a patch, you simply don't get 32 that much options for refreshing a block. 33 34 Installation: 35 ------------- 36 1. Place this module directory in your modules folder (this will 37 usually be "sites/all/modules/"). 38 2. Go to "administer -> build -> modules" and enable the module. 39 40 3. Either copy the right patched block.module file or you can 41 apply one of the 2 core patches if you like. If you patch, copy 42 the patchfile to modules/block and run following command: 43 44 patch -p0 < filename. 45 46 To reverse the patch, simple run following command: 47 48 patch -R -p0 < filename 49 50 Configuration: 51 -------------- 52 Go to "administer -> settings -> blockcache_alter" where you have 2 options 53 54 - core patch: toggle this checkbox if you have applied one of the 2 core 55 patches. Additional options for refreshing the block will appear in the caching 56 fieldset on the block configuration page. Note: if you didn't apply a core patch, 57 these additional settings simply won't have any effect. 58 - Debug: apply this only during testing and development. It will show you 59 messages when a block is refreshed. 60 61 Calling a block from code 62 ------------------------- 63 Sometimes, developers do not enable the block itself, but call it with the 64 module_invoke() function to put it somewhere they need. In that case blocks don't 65 get cached even if all cache settings are set, because the block does not belong to 66 any region. To work around that problem: 67 68 1. set the cache settings for the block as you desire, leave it disabled 69 2. call the block with the following piece of code: 70 71 <?php 72 $block = module_invoke('blockcache_alter', 'block', 'view', 'block,14'); 73 print $block['content']; 74 ?> 75 76 The last parameter should consist of the name of original block and its original delta 77 seperated by comma. All blocks are cached that way. 78 79 Support: 80 -------- 81 Please use the issue queue available at http://drupal.org/project/blockcache_alter to 82 file support and feature requests, bugs etc. Be as descriptive as you can. 83 84 Last updated: 85 ------------ 86 ; $Id: README.txt,v 1.1.2.6 2009/06/02 18:35:58 swentel Exp $
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |