-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path19659_out_of_page_slot-6.patch
36 lines (34 loc) · 1.68 KB
/
19659_out_of_page_slot-6.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff --git a/dfp.module b/dfp.module
index c377ed2..7fad264 100644
--- a/dfp.module
+++ b/dfp.module
@@ -716,7 +716,12 @@ function _dfp_js_global_settings() {
*/
function _dfp_js_slot_definition($tag) {
// Add the js needed to define this adSlot to <head>.
- $js = 'googletag.slots.' . $tag->machinename . ' = googletag.defineSlot("' . $tag->adunit . '", ' . $tag->size . ', "' . $tag->placeholder_id . '")' . "\n";
+ if (isset($tag->out_of_page) && $tag->out_of_page) {
+ $js = 'googletag.slots.' . $tag->machinename . ' = googletag.defineOutOfPageSlot("' . $tag->adunit . '", "' . $tag->placeholder_id . '")' . "\n";
+ }
+ else {
+ $js = 'googletag.slots.' . $tag->machinename . ' = googletag.defineSlot("' . $tag->adunit . '", ' . $tag->size . ', "' . $tag->placeholder_id . '")' . "\n";
+ }
$js .= ' .addService(googletag.pubads())' . "\n";
if (!empty($tag->adsense_ad_types)) {
diff --git a/plugins/export_ui/dfp_ctools_export_ui.inc b/plugins/export_ui/dfp_ctools_export_ui.inc
index ac859d0..6bf7307 100644
--- a/plugins/export_ui/dfp_ctools_export_ui.inc
+++ b/plugins/export_ui/dfp_ctools_export_ui.inc
@@ -143,6 +143,13 @@ function dfp_tag_form(&$form, &$form_state) {
'#default_value' => $tag->settings['short_tag'],
'#parents' => array('settings', 'short_tag'),
);
+ $form['tag_display_options']['out_of_page'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Out of page (interstitial) ad slot'),
+ '#description' => t('Constructs an out of page (interstitial) ad slot.'),
+ '#default_value' => $tag->settings['out_of_page'],
+ '#parents' => array('settings', 'out_of_page'),
+ );
// Targeting options.
$form['targeting_settings'] = array(