FIX: Support for embedding ads via component
This commit is contained in:
parent
de4a8366fc
commit
1cd0bef933
|
@ -0,0 +1,33 @@
|
||||||
|
{{#if site.mobileView}}
|
||||||
|
{{#if model.postSpecificCountAdsense}}
|
||||||
|
{{#if siteSettings.adsense_mobile_post_bottom_code}}
|
||||||
|
{{google-adsense placement="post-bottom" postNumber=model.post_number}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{#if model.postSpecificCountDFP}}
|
||||||
|
{{#if siteSettings.dfp_mobile_post_bottom_code}}
|
||||||
|
{{google-dfp-ad placement="post-bottom" category=model.topic.category.slug postNumber=model.post_number}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{#if model.postSpecificCountAmazon}}
|
||||||
|
{{#if siteSettings.amazon_mobile_post_bottom_src_code}}
|
||||||
|
{{amazon-product-links placement="post-bottom" postNumber=model.post_number}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
{{#if model.postSpecificCountAdsense}}
|
||||||
|
{{#if siteSettings.adsense_post_bottom_code}}
|
||||||
|
{{google-adsense placement="post-bottom" postNumber=model.post_number}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{#if model.postSpecificCountDFP}}
|
||||||
|
{{#if siteSettings.dfp_post_bottom_code}}
|
||||||
|
{{google-dfp-ad placement="post-bottom" category=model.topic.category.slug postNumber=model.post_number}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{#if model.postSpecificCountAmazon}}
|
||||||
|
{{#if siteSettings.amazon_post_bottom_src_code}}
|
||||||
|
{{amazon-product-links placement="post-bottom" postNumber=model.post_number}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
|
@ -1,33 +1 @@
|
||||||
{{#if site.mobileView}}
|
{{adplugin-container model=this}}
|
||||||
{{#if postSpecificCountAdsense}}
|
|
||||||
{{#if siteSettings.adsense_mobile_post_bottom_code}}
|
|
||||||
{{google-adsense placement="post-bottom" postNumber=post_number}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
{{#if postSpecificCountDFP}}
|
|
||||||
{{#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}}
|
|
||||||
|
|
|
@ -30,6 +30,12 @@ export default {
|
||||||
|
|
||||||
withPluginApi('0.1', api => {
|
withPluginApi('0.1', api => {
|
||||||
api.decorateWidget('post:after', dec => {
|
api.decorateWidget('post:after', dec => {
|
||||||
|
|
||||||
|
if (dec.canConnectComponent) {
|
||||||
|
return dec.connect({ component: 'adplugin-container', context: 'model' });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Old way for backwards compatibility
|
||||||
return dec.connect({
|
return dec.connect({
|
||||||
templateName: 'connectors/post-bottom/discourse-adplugin',
|
templateName: 'connectors/post-bottom/discourse-adplugin',
|
||||||
context: 'model'
|
context: 'model'
|
||||||
|
|
Loading…
Reference in New Issue