FIX: showing ads on mobile when mobile ad units are not defined

This commit is contained in:
Neil Lalonde 2016-11-17 11:45:18 -05:00
parent 883d5ecd85
commit 910b0d0e4c
4 changed files with 93 additions and 33 deletions

View File

@ -1,9 +1,21 @@
{{#if siteSettings.adsense_topic_list_top_code}} {{#if site.mobileView}}
{{google-adsense placement="topic-list-top"}} {{#if siteSettings.adsense_mobile_topic_list_top_code}}
{{/if}} {{google-adsense placement="topic-list-top"}}
{{#if siteSettings.dfp_topic_list_top_code}} {{/if}}
{{google-dfp-ad placement="topic-list-top" refreshOnChange=loading category=category.slug}} {{#if siteSettings.dfp_mobile_topic_list_top_code}}
{{/if}} {{google-dfp-ad placement="topic-list-top" refreshOnChange=loading category=category.slug}}
{{#if siteSettings.amazon_topic_list_top_src_code}} {{/if}}
{{amazon-product-links placement="topic-list-top"}} {{#if siteSettings.amazon_mobile_topic_list_top_src_code}}
{{amazon-product-links placement="topic-list-top"}}
{{/if}}
{{else}}
{{#if siteSettings.adsense_topic_list_top_code}}
{{google-adsense placement="topic-list-top"}}
{{/if}}
{{#if siteSettings.dfp_topic_list_top_code}}
{{google-dfp-ad placement="topic-list-top" refreshOnChange=loading category=category.slug}}
{{/if}}
{{#if siteSettings.amazon_topic_list_top_src_code}}
{{amazon-product-links placement="topic-list-top"}}
{{/if}}
{{/if}} {{/if}}

View File

@ -1,9 +1,33 @@
{{#if postSpecificCountAdsense}} {{#if site.mobileView}}
{{google-adsense placement="post-bottom" postNumber=post_number}} {{#if postSpecificCountAdsense}}
{{/if}} {{#if siteSettings.adsense_mobile_post_bottom_code}}
{{#if postSpecificCountDFP}} {{google-adsense placement="post-bottom" postNumber=post_number}}
{{google-dfp-ad placement="post-bottom" category=topic.category.slug postNumber=post_number}} {{/if}}
{{/if}} {{/if}}
{{#if postSpecificCountAmazon}} {{#if postSpecificCountDFP}}
{{amazon-product-links placement="post-bottom" postNumber=post_number}} {{#if siteSettings.dfp_mobile_post_bottom_code}}
{{google-dfp-ad placement="post-bottom" category=topic.category.slug postNumber=post_number}}
{{/if}}
{{/if}}
{{#if postSpecificCountAmazon}}
{{#if siteSettings.amazon_mobile_post_bottom_src_code}}
{{amazon-product-links placement="post-bottom" postNumber=post_number}}
{{/if}}
{{/if}}
{{else}}
{{#if postSpecificCountAdsense}}
{{#if siteSettings.adsense_post_bottom_code}}
{{google-adsense placement="post-bottom" postNumber=post_number}}
{{/if}}
{{/if}}
{{#if postSpecificCountDFP}}
{{#if siteSettings.dfp_post_bottom_code}}
{{google-dfp-ad placement="post-bottom" category=topic.category.slug postNumber=post_number}}
{{/if}}
{{/if}}
{{#if postSpecificCountAmazon}}
{{#if siteSettings.amazon_post_bottom_src_code}}
{{amazon-product-links placement="post-bottom" postNumber=post_number}}
{{/if}}
{{/if}}
{{/if}} {{/if}}

View File

@ -1,9 +1,21 @@
{{#if siteSettings.adsense_topic_above_post_stream_code}} {{#if site.mobileView}}
{{google-adsense placement="topic-above-post-stream"}} {{#if siteSettings.adsense_mobile_topic_above_post_stream_code}}
{{/if}} {{google-adsense placement="topic-above-post-stream"}}
{{#if siteSettings.dfp_topic_above_post_stream_code}} {{/if}}
{{google-dfp-ad placement="topic-above-post-stream" refreshOnChange=model.id category=model.category.slug}} {{#if siteSettings.dfp_mobile_topic_above_post_stream_code}}
{{/if}} {{google-dfp-ad placement="topic-above-post-stream" refreshOnChange=model.id category=model.category.slug}}
{{#if siteSettings.amazon_topic_above_post_stream_src_code}} {{/if}}
{{amazon-product-links placement="topic-above-post-stream"}} {{#if siteSettings.amazon_mobile_topic_above_post_stream_src_code}}
{{amazon-product-links placement="topic-above-post-stream"}}
{{/if}}
{{else}}
{{#if siteSettings.adsense_topic_above_post_stream_code}}
{{google-adsense placement="topic-above-post-stream"}}
{{/if}}
{{#if siteSettings.dfp_topic_above_post_stream_code}}
{{google-dfp-ad placement="topic-above-post-stream" refreshOnChange=model.id category=model.category.slug}}
{{/if}}
{{#if siteSettings.amazon_topic_above_post_stream_src_code}}
{{amazon-product-links placement="topic-above-post-stream"}}
{{/if}}
{{/if}} {{/if}}

View File

@ -1,9 +1,21 @@
{{#if siteSettings.adsense_topic_above_suggested_code}} {{#if site.mobileView}}
{{google-adsense placement="topic-above-suggested"}} {{#if siteSettings.adsense_mobile_topic_above_suggested_code}}
{{/if}} {{google-adsense placement="topic-above-suggested"}}
{{#if siteSettings.dfp_topic_above_suggested_code}} {{/if}}
{{google-dfp-ad placement="topic-above-suggested" refreshOnChange=model.id category=model.category.slug}} {{#if siteSettings.dfp_mobile_topic_above_suggested_code}}
{{/if}} {{google-dfp-ad placement="topic-above-suggested" refreshOnChange=model.id category=model.category.slug}}
{{#if siteSettings.amazon_topic_above_suggested_src_code}} {{/if}}
{{amazon-product-links placement="topic-above-suggested"}} {{#if siteSettings.amazon_mobile_topic_above_suggested_src_code}}
{{amazon-product-links placement="topic-above-suggested"}}
{{/if}}
{{else}}
{{#if siteSettings.adsense_topic_above_suggested_code}}
{{google-adsense placement="topic-above-suggested"}}
{{/if}}
{{#if siteSettings.dfp_topic_above_suggested_code}}
{{google-dfp-ad placement="topic-above-suggested" refreshOnChange=model.id category=model.category.slug}}
{{/if}}
{{#if siteSettings.amazon_topic_above_suggested_src_code}}
{{amazon-product-links placement="topic-above-suggested"}}
{{/if}}
{{/if}} {{/if}}