XF 1.1 Different Adsense in ArticleView then in Normal Threads

TsinJu

Well-known member
Since i use Xenporta i also use the ArticleView for the posted News etc.
But... the Page is smaller thats why my 728:90 Adsense Code is to large.
I now wanted to use "xen if else condition" to show a different Adsense Code if its the ArticleView but it wont work and i really tried a lot.

I added a new Template called "ad_message_article_below"
And filled with my Adsense Code starting by the ad_message_article_below Hook

In "ad_message_below" i added the Code below.

The problem i have now is that <xen:if is="{$contentTemplate} == 'EWRporta_ArticleView'"> wont work, means i do just get the larger Adsense Code displayed, but it should be an Adsense Code with 250:250

I also tried EWRporta_ArticleMessage and EWRporta_ArticlePost but none of them is giving the Result i would like to get.

HTML:
<xen:hook name="ad_message_below" />

<xen:if is="{$contentTemplate} == 'EWRporta_ArticleView'">
<xen:include template="ad_message_article_below" />
<xen:else />
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
        <li class="message">
            <div class="messageUserInfo">
                <div class="messageUserBlock">
                    <div class="avatarHolder" style="height: 102px; width: 102px">
                        <span class="helper"></span>
                        <img src="styles/brainlag/advertising_target.png" alt="Avatar" height="96px" width="96px" style="border: 1px solid #C0C0C0; padding: 2px" />
                    </div>
                    <h3 class="userText">
                        <span style="font-weight: bold; color: #176093">Google AdSense</span>
                    <em class="userTitle" itemprop="title">Advertisement</em>
                    </h3>
                    <span class="arrow"><span></span></span>
                </div>
            </div>
            <div class="messageInfo primaryContent">
                <div id="adsenseBorder" class="messageContent">
                    <article>
                        <blockquote class="messageText ugc baseHtml">
                            <div class="adsensePosition">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-myID";
/* Thread_after-first-post */
google_ad_slot = "my_adsense_slot";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
                            </div>
                        </blockquote>
                    </article>
                </div>
            </div>
        </li>
</xen:if>
</xen:if>
 
Can be closed. I have done it a different way.
I have added 2 new Templates with different Variables to get this working. Not an elegant solution but it works aswell
 
Back
Top Bottom