chameleon theme not outputting $closure variable
ahaze - May 11, 2007 - 02:28
| Project: | Chameleon |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
I tried installing nicemenus to control my primary links, but it was too much hassle to get it to work properly (and the same) in ff and ie. Someone suggested I try simplemenu. At the moment I'm using the Chameleon/Marvin theme. I disabled nicemenus, changed all my css files and my .theme file back to normal, and installed and enabled simplemenu. I configured it for primary links, and to prepend to the body. My site is here. The primary links are running under the site logo.
It would appear that even though I've enabled simplemenu, it isn't taking. I've cleared my local cache and the db cache. Any ideas? Thanks in advance.

#1
You have to make sure the permissions for this module are enabled. There is a view permission which determines which role can see the menu.
#2
No, SimpleMenu doesn't actually display in Chameleon. This is with the #1 user, so it has permissions to see SimpleMenu.
#3
does this still apply with the new 5.0 version?
#4
The (very quick) test that I did shows that SimpeMenu still doesn't display in Chameleon. Is it because Chameleon is not a PHPTemplate theme?
#5
The solution _is_ a one-liner:
Add these lines just above "$output = " theme('closure'),
);
Cheers,
Fredrik
#6
The solution is more or less a one-liner:
Add these lines:
// Needed for chameleon theme to include SimpleMenu js+css$variables = array(
'closure' => theme('closure'),
);
just above:
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";$output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"$language\" xml:lang=\"$language\">\n";
in chameleon.theme (= just above Line 39).
Cheers,
Fredrik
#7
Seems like that is an issue with the chameleon theme and should be an issue for core...
#8
On line 118 of chameleon.theme the closure is called:
$output .= theme_closure();The problem is that hook_footer of simple_menu is adding css through drupal_add_css and that chameleon already called drupal_get_css on line 48 so the added css is never included in the page.
Using motin's fix theme_closure (and effectively) hook_footer is called twice; once before outputting the header and once on line 118 as mentioned above.
To use motin's fix and prevent hook_footer from being called twice we could call theme_closure before outputting the header and catch the returned values (if any).
Then we output the page and finally we output the result of theme_closure before we close the body tag.
I've attached a patch for testing and discussion.
- Arie
#9
No reviews yet. Setting this to bug report to get some attention. Arguably it is a bug.
- Arie
#10
Bumping this issue one last time.
- Arie
#11
Judging from the overwhelming attention it looks like this patch is not 'popular' enough to be tested or applied.
- Arie
#12
I agree with you that this can be called a bug, so I'd leave it as CNR until someone finally decides to review it, even though it's not popular. Chameleon is currently broken (#374650: Chameleon broken by hook_page_alter), so this patch will probably have to be re-rolled after that has been resolved.
I wouldn't mind applying/testing/reviewing this patch after that one has landed...
#13
Chameleon has been moved from core to contrib, changing queue.
#374650: Chameleon broken by hook_page_alter
#315533: Remove all themes but Garland and Stark from core
#14
OK rerolled for chameleon contributed theme.
- Arie