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
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

Arancaytar - July 12, 2007 - 13:25

I'll test this soon.

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

#2

merlinofchaos - July 12, 2007 - 15:29
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

archetwist - April 24, 2008 - 14:54
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

Arancaytar - June 23, 2008 - 13:03
Project:DHTML Menu» Interlaced
Version:5.x-1.2» HEAD
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

Arancaytar - June 23, 2008 - 13:09

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

 
 

Drupal is a registered trademark of Dries Buytaert.