JS not being added to Interlaced theme
macros - May 31, 2007 - 08:12
| Project: | Interlaced |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Using DHTML Menus on the Interlaced theme doesn't seem to be adding the javascript to open & close the menus. It works fine for the Garland theme.

#1
I'll test this soon.
The theme in question is here: http://drupal.org/project/interlaced
#2
This probably means that the Interlaced theme is missing the $scripts variable in the
<HEAD>section, which is a very common error for themes that were upgraded from 4.7 but not very carefully.#3
I am experiencing the same issue. I don't think the problem lies in the theme as the
interlaced.themefile contains the following code:$output .= drupal_get_js();Other JS files (from other modules) are loading fine.
#4
This is a problem in Interlaced. The theme is trying to get Javascript code with drupal_get_js() before the modules are executed; not even drupal.js and jquery.js are added.
#5
I can identify the problem: You're trying to generate output in the same order as it is displayed on the page. This is impossible. You can't call theme('blocks') after building the HTML head, because the blocks might want to add more stylesheets or scripts, as DHTML Menu is doing. The only scripts you get this way are those added in hook_init.
You can fix your theme by generating the separate parts of the page first, and then building the HTML head. You need to execute all those theme() calls before calling drupal_get_js() and drupal_get_css().