Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 9, 20168 yr Is there any way to show the advert inside the first post rather than after?
November 17, 20168 yr yes there is a way you have to go to your them and look for forum display just put it where you want but it will show in all the forums..
November 17, 20168 yr Create an advertisement (or advertisements) and set it/them to display in a custom location called inside_first_post (or whatever you want it to be) Edit your theme, specifically forums -> front -> topics -> post Locate: {$comment->content()|raw} Add above it/below it: {{if $comment->mapped('first') }} {advertisement="inside_first_post"} {{endif}} Save, refresh, marvel at how easy it actually was to do It's up to you to handle the finer details of positioning within the post (ie left/right/center/up/down - handle that within the advertisement html code) but there's your starting point above. And observe the problem you introduce by adding this to the first post....it's part of the post, so it will be included in quotes of that post. Probably easy to overcome with placing the additional content in the template outside (ie after the closure) of the 'commentContent' div, but will let you try that out.
November 17, 20168 yr Author That almost works perfect, but I'd like it to appear on the first post of each page. If I use that code it only works on the first post on the first page, not every page.
November 17, 20168 yr 9 minutes ago, marklcfc said: That almost works perfect Works perfect for what you requested, and you're welcome. You've now got your starting point - the 'first post' in a topic isn't the same as the 'first post on each page of a multi-page topic, so the above isn't going to work as you now want it. Now what you need to do is take the time (just like I did with the above) and think about if it's possible to identify the 'first page on each post of a multi-page topic' in the template.
November 17, 20168 yr @Nathan Explosion I can recognize one of the coins I have on my forum. It is not a problem at all, but how it is possible ?
November 17, 20168 yr Just now, EricT said: @Nathan Explosion I can recognize one of the coins I have on my forum. It is not a problem at all, but how it is possible ? You were asking in a thread on here recently on how to rotate pics - I tried something out, it didn't work, I didn't bother going any further. And it's possible because you provided the url to it in that topic.
November 17, 20168 yr Author 3 hours ago, Nathan Explosion said: Works perfect for what you requested, and you're welcome. You've now got your starting point - the 'first post' in a topic isn't the same as the 'first post on each page of a multi-page topic, so the above isn't going to work as you now want it. Now what you need to do is take the time (just like I did with the above) and think about if it's possible to identify the 'first page on each post of a multi-page topic' in the template. Wouldn't know where to start
November 20, 20168 yr {{if $_REQUEST['ad_inside_first_post'] = !isset($_REQUEST['ad_inside_first_post']) ? 1 : 0}} {advertisement="inside_first_post"} {{endif}}
November 20, 20168 yr Author 2 hours ago, newbie LAC said: {{if $_REQUEST['ad_inside_first_post'] = !isset($_REQUEST['ad_inside_first_post']) ? 1 : 0}} {advertisement="inside_first_post"} {{endif}} That is great, however there is an issue. When quoting the post with the advert, it tries to quote the ad (highlighted below). Is it to do with where I place the code? I placed it where Nathan suggested above.
November 20, 20168 yr 14 minutes ago, marklcfc said: That is great, however there is an issue. When quoting the post with the advert it, it quotes the box (highlighted below). Is it to do with where I place the code? I placed it where Nathan suggested above. You should to put your code outside div with data-role='commentContent' or add data-excludequote to your ad code. See example here https://invisionpower.com/forums/topic/429838-nb41-enhanced-advertisements/?do=findComment&comment=2641576
November 20, 20168 yr If only I'd pointed out that issue and a possible fix in my initial post, eh? Glad you have things sorted out anyway.
January 20, 20178 yr This works good, I'm using {{if $_REQUEST['ad_inside_first_post'] = !isset($_REQUEST['ad_inside_first_post']) ? 1 : 0}} <div style="float:right; position:relative; padding: 0 0 0 5px;" data-excludequote> {advertisement="inside_first_post"} </div> {{endif}} Does anyone know how to get it inline and not below the post text in {$comment->content()|raw}?
March 30, 20178 yr It looks like that some user see the ad in every post of the page. I can't reproduce it on my systems but I saw the screenshots of them. Maybe $_REQUEST isn't transferred to the next post for all people. Does anybody else have this issue?
March 30, 20178 yr BTW, is there any other parameter besides "data-excludequote" because the empty area is being shown immediately after having sent a new post? Ajax puts it to the end and shows an empty area. Only reloading the page removes it.
Archived
This topic is now archived and is closed to further replies.