post-bottom additions and test.hbs

This commit is contained in:
Sarah Ni 2015-07-30 11:05:33 +10:00
parent 4e896abd4d
commit 49b89e90a8
13 changed files with 24 additions and 2 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -35,6 +35,9 @@ function loadGoogle(settings) {
if (settings.dfp_topic_above_suggested_code && !settings.dfp_show_topic_above_suggested) {
googletag.defineSlot(settings.dfp_topic_above_suggested_code, [parseInt(settings.dfp_size_topic_above_suggested_width_code), parseInt(settings.dfp_size_topic_above_suggested_height_code)], 'div-gpt-ad-topic-above-suggested').addService(googletag.pubads());
}
if (settings.dfp_post_bottom_code && !settings.dfp_show_post_bottom) {
googletag.defineSlot(settings.dfp_post_bottom_code, [parseInt(settings.dfp_size_post_bottom_width_code), parseInt(settings.dfp_size_post_bottom_height_code)], 'div-gpt-ad-post-bottom').addService(googletag.pubads());
}
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});

View File

@ -1,5 +1,5 @@
<div class="google-dfp-ad-label"><h2>Google Ad Plugin Display</h2></div>
<div id={{divId}} style='width: {{const_width}}px; height: {{const_height}}px' class="dfp-ad-unit" align=center>
<div id={{divId}} style='width: {{const_width}}px; height: {{const_height}}px' class="dfp-ad-unit" align=center>
{{#if loadedGoogletag}}
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('{{divId}}'); });

View File

@ -0,0 +1,3 @@
{{#if siteSettings.dfp_post_bottom_code}}
{{google-dfp-ad placement="post-bottom"}}
{{/if}}

View File

0
config/locales/client.en.yml Normal file → Executable file
View File

6
config/locales/server.en.yml Normal file → Executable file
View File

@ -6,9 +6,13 @@ en:
dfp_topic_above_post_stream_code: "Show leaderboard ad above post stream"
dfp_show_topic_above_suggested: "Disable topic_above_suggested ad"
dfp_topic_above_suggested_code: "Show leaderboard ad above suggested topics"
dfp_show_post_bottom: "Disable post_bottom ad"
dfp_post_bottom_code: "Show leaderboard ad post_bottom topics"
dfp_size_topic_list_top_width_code: "Put your ad topic list top size width!"
dfp_size_topic_list_top_height_code: "Put your ad topic above post stream size height!"
dfp_size_topic_above_post_stream_width_code: "Put your ad topic above post stream size width!"
dfp_size_topic_above_post_stream_height_code: "Put your ad topic list top size height!"
dfp_size_topic_above_suggested_width_code: "Put your ad topic above suggested size width!"
dfp_size_topic_above_suggested_height_code: "Put your ad topic above suggested size height!"
dfp_size_topic_above_suggested_height_code: "Put your ad topic above suggested size height!"
dfp_size_post_bottom_width_code: "Put your ad post bottom size width!"
dfp_size_post_bottom_height_code: "Put your ad post bottom size height!"

12
config/settings.yml Normal file → Executable file
View File

@ -33,5 +33,17 @@ ad_plugin:
client: true
default: ''
dfp_show_topic_above_suggested:
client: true
default: false
dfp_post_bottom_code:
client: true
default: ''
dfp_size_post_bottom_width_code:
client: true
default: ''
dfp_size_post_bottom_height_code:
client: true
default: ''
dfp_show_post_bottom:
client: true
default: false

0
plugin.rb Normal file → Executable file
View File