In some case adding javascript in _preprocess page is too late. I'm working with a zen subtheme, and javascript isn't loaded here. The js array are built for html.tpl.php, so the correct place is to add your html is the dfp_preprocess_html.

CommentFileSizeAuthor
#2 1772188_1_change_page_preprocess.patch471 bytesszantog

Comments

szantog’s picture

Title: Use _preprocess_html agains _preprocess_page » Use _preprocess_html against _preprocess_page

fix title

szantog’s picture

Status: Active » Needs review
StatusFileSize
new471 bytes

Well, let's make it official. :)

bleen’s picture

Status: Needs review » Needs work

But what about that comment?

   // Add the header js here so that enough information has been loaded for
   // tokens to work properly

I believe I have tried to out this code in preprocessing HTML but that many on the tokens failed to populate at that point. If you can confirm that I'm wrong then I'll consider this patch

bleen’s picture

Although ... It seems that all tests passed. Hmmm. Let me take a closer look

bleen’s picture

Status: Needs work » Fixed

I took a closer works, and this looks fine. I committed the patch in #2 (fixing the phpdoc as well)

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.