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

momendo - June 29, 2007 - 13:55

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

Richard Eriksson - October 30, 2007 - 16:35

No, SimpleMenu doesn't actually display in Chameleon. This is with the #1 user, so it has permissions to see SimpleMenu.

#3

m3avrck - January 26, 2008 - 23:10

does this still apply with the new 5.0 version?

#4

Richard Eriksson - January 28, 2008 - 20:35

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

motin - February 22, 2008 - 16:35

The solution _is_ a one-liner:

Add these lines just above "$output = " theme('closure'),
);

Cheers,

Fredrik

#6

motin - February 22, 2008 - 16:39

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

m3avrck - February 22, 2008 - 16:54
Title:enabled but not enabled?» chameleon theme not outputting $closure variable
Project:SimpleMenu» Drupal
Version:5.x-3.2» 7.x-dev
Component:Code» theme system

Seems like that is an issue with the chameleon theme and should be an issue for core...

#8

ainigma32 - November 30, 2008 - 12:49
Status:active» needs review

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

AttachmentSize
chameleon_0.patch 1.01 KB
Testbed results
chameleon_0.patchpassedPassed: 10451 passes, 0 fails, 0 exceptions Detailed results

#9

ainigma32 - December 15, 2008 - 09:03
Category:support request» bug report

No reviews yet. Setting this to bug report to get some attention. Arguably it is a bug.

- Arie

#10

ainigma32 - December 31, 2008 - 09:55

Bumping this issue one last time.

- Arie

#11

ainigma32 - January 14, 2009 - 11:44
Status:needs review» won't fix

Judging from the overwhelming attention it looks like this patch is not 'popular' enough to be tested or applied.

- Arie

#12

mr.baileys - February 17, 2009 - 08:01
Status:won't fix» needs review

looks like this patch is not 'popular' enough to be tested or applied.

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

mr.baileys - March 10, 2009 - 07:21
Project:Drupal» Chameleon
Version:7.x-dev» 7.x-1.x-dev
Component:theme system» Code
Status:needs review» needs work

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

ainigma32 - March 12, 2009 - 21:42
Status:needs work» needs review

OK rerolled for chameleon contributed theme.

- Arie

AttachmentSize
chameleon_standalone.patch 982 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.