Hi, I'm experimenting with the Dart module and so far it ticks all the boxes for Doubleclick integration. Ideally I'd like to load the document.writes later so it doesn't block the loading of the page if the adserver is slow and I noticed you'd implemented the WriteCapture plugin. I'm having some trouble enabling it successfully and was hoping for some guidance as I couldn't find any documentation.
So far I've downloaded the library, put it in the correct location: sites/all/libraries/writecapture/jquery.writeCapture.js
I've enabled Dart, created a block and placed it on a page. The block loads and displays an advertisement fine.
Then I activated the load last functionality by adding $conf['dart_load_last'] = TRUE; to my settings.php file.
After this I get the following errors in console: Drupal.DART is undefined and Drupal.DART.settings.loadLastTags is undefined
Is there anything else I need to do? Anything I need to modify?
Comment | File | Size | Author |
---|---|---|---|
#7 | 1333918-fix-load-last.patch | 5.66 KB | bleen |
#4 | 1333918-fix_load_last_classes.patch | 6.07 KB | tanc |
#3 | 1333918-fix-load-last.patch | 4 KB | bleen |
Comments
Comment #1
bleen CreditAttribution: bleen commentedThere seems to be a few problems with the "load last" functionality .. not the least of which is the missing checkbox to toggle it on/off. Additionally, when it is checked, the dart.js is being loaded after the inline js that dart includes - which is the cause of the specific error you are seeing.
In any case, I'm banging on this one right now. I cant fathom how things got this messed up though...
Comment #2
bleen CreditAttribution: bleen commentedComment #3
bleen CreditAttribution: bleen commentedthis should fix it ... any chance you can test out this patch and confirm?
Comment #4
tancThat patch didn't quite work because the classes array on the dart block wasn't correctly defined so the js couldn't grab the name properly. I've attached an updated patch which works for me. Thanks!
Comment #5
tancBeen using my patch in #4 for a couple of days now with no errors so its all looking good!
Comment #6
bleen CreditAttribution: bleen commentedI've added a bunch of the coding standards fixes you included in your patch (thanks!) but I'm not seeing why this is needed:
+++ b/dart.moduleundefined
@@ -563,7 +564,7 @@ function _dart_get_page_key_vals() {
- $variables['attributes_array']['class'] = 'dart-tag dart-name-' . $tag->machinename;
+ $variables['classes_array'][] = 'dart-name-' . $tag->machinename;
I have a basic D7 install with one ad (loading last) and everything appears fine:
Can you explain a bit more the issue you are having with this patch as-is
Comment #7
bleen CreditAttribution: bleen commentedoops .. forgot patch
Comment #8
tancHmm... Thats odd because when my blocks are rendered $variables['attributes_array']['class'] doesn't output the class in the html, while $variables['classes_array'][] works just fine. I'm trying to think why that might be. Could it be theme related? I'm using Omega on this test site and Context to place the blocks.
Comment #9
tancLooking at template_preprocess_block it looks like classes_array is the standard way of adding additional classes. I could very well be mistaken and I have to say I'm not testing this on a fresh install with the default theme.
Comment #10
bleen CreditAttribution: bleen commentedfor now I went ahead and committed #7 to 7.x-2.x-dev ... if you can make a more compelling argument for the change to how classes are displayed in the tpl please reopen
Comment #12
scottatdrake CreditAttribution: scottatdrake commentedThe $variables['attributes_array']['class'] thing was a problem for me, too. I had to use $variables['classes_array'][] to get them to display. See http://drupal.org/node/1526442#comment-5856726