Download & Extend

JS not being added to Interlaced theme

Project:Interlaced
Version:master
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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.

Comments

#1

I'll test this soon.

The theme in question is here: http://drupal.org/project/interlaced

#2

Project:DHTML Menu» Interlaced
Version:5.x-0.7» 5.x-1.x-dev
Component:Javascript code» Code

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

Project:Interlaced» DHTML Menu
Version:5.x-1.x-dev» 5.x-1.2
Component:Code» Javascript code

I am experiencing the same issue. I don't think the problem lies in the theme as the interlaced.theme file contains the following code:

$output .= drupal_get_js();

Other JS files (from other modules) are loading fine.

#4

Project:DHTML Menu» Interlaced
Version:5.x-1.2» master
Component:Javascript code» Code

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().

nobody click here