I installed the module and was able to create a test bundle. I've read through the documentation, however do not see any reference to dealing with the module not being able to 'hook into my theme'. I am using the 'zen' theme with a custom sub-theme. Is there something that I need to add to my template.php file, or some other way to make the zen theme play nice? This is a fantastic module, and would really help boost performance on my site.

Comments

kkaefer’s picture

Status: Active » Postponed (maintainer needs more info)

I added this section to the README.txt:

It is possible that you get a "The Support file Cache module can't hook into your theme. Please consult the manual." message depending on the theme you use. To solve this problem, you unfortunately have to modify your theme. In the theme's template.php file, look for the function "_phptemplate_page". Inside that function, insert as first command:
sf_cache_dispatch($variables);

Also make sure that $variables is the name of the first parameter of the "_phptemplate_page" function. If you're done with that, comment out the "drupal_set_message(...)" line in the sf_cache_footer() function in sf_cache.module.

kkaefer’s picture

Status: Postponed (maintainer needs more info) » Fixed

Feel free to reopen the issue if my explanation does not fix your problem.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

lejon’s picture

Status: Closed (fixed) » Active

I have the same problem. Zen is different from other themes so there isn't a _phptemplate_page bit to alter:

* DIFFERENCES BETWEEN ZEN SUB-THEMES AND NORMAL DRUPAL SUB-THEMES
*
* The Zen theme allows its sub-themes to have their own template.php files. The
* only restriction with these files is that they cannot redefine any of the
* functions that are already defined in Zen's main template files:
* template.php, template-menus.php, and template-subtheme.php.
* Every theme override function used in those files is documented below in this
* file.
*
* Also remember that the "main" theme is still Zen, so your theme override
* functions should be named as such:
* theme_block() becomes zen_block()
* theme_feed_icon() becomes zen_feed_icon() as well
*
* However, there are two exceptions to the "theme override functions should use
* 'zen' and not 'mytheme'" rule. They are as follows:
*
* Normally, for a theme to define its own regions, you would use the
* THEME_regions() fuction. But for a Zen sub-theme to define its own regions,
* use the function name
* STARTERKIT_regions()
* where STARTERKIT is the name of your sub-theme. For example, the zengo_classic
* theme would define a zengo_classic_regions() function.
*
* For a sub-theme to add its own variables, instead of _phptemplate_variables,
* use these functions:
* STARTERKIT_preprocess_page(&$vars) to add variables to the page.tpl.php
* STARTERKIT_preprocess_node(&$vars) to add variables to the node.tpl.php
* STARTERKIT_preprocess_comment(&$vars) to add variables to the comment.tpl.php
* STARTERKIT_preprocess_block(&$vars) to add variables to the block.tpl.php
*/

Any ideas where the sfcache stuff would go?

Thanks!

stevebayerin’s picture

This is what I did. Added in template.php (changing STARTERKIT to the sub theme name)

function STARTERKIT_preprocess_page(&$vars) {
sf_cache_dispatch($variables);
}

I had to clear Drupal's (D5) Cache before activating the module or I'd get a WSOD.

After the cache clear and addition of the above template.php snippet, I don't get a WSOD however I also don't see a support file cache admin page. I'm trying to set up sf_cache since I've had issues styling panel blocks in Panels 2 Beta 4 when using Drupals built in CSS compressor.

kkaefer’s picture

$vars should be the same name as $variables, change either of those to match the other. You only should have to add that function if you're *NOT* using PHPTemplate.

As for you not seeing the admin panel, please try going to the menu admin page to clear the menu cache. it's also worth reinstalling the module (either via devel.module's functionality or by disabling, uninstalling and enabling it again). The menu is in Admin >> Site building >> Support files.

kkaefer’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.