-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2038965-out_of_page_slot-34.patch
36 lines (35 loc) · 1.77 KB
/
2038965-out_of_page_slot-34.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 525ea62..f6d895f 100644
--- a/dfp.module
+++ b/dfp.module
@@ -723,7 +723,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";
+ }
$click_url = variable_get('dfp_click_url', '');
if (!empty($click_url)) {
if (!preg_match("/^https?:\/\//", $click_url)) {
diff --git a/plugins/export_ui/dfp_ctools_export_ui.inc b/plugins/export_ui/dfp_ctools_export_ui.inc
index ac859d0..34eae7c 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' => isset($tag->settings['out_of_page']) ? $tag->settings['out_of_page'] : 0,
+ '#parents' => array('settings', 'out_of_page'),
+ );
// Targeting options.
$form['targeting_settings'] = array(