Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
marklcfc Posted November 9, 2016 Posted November 9, 2016 Is there any way to show the advert inside the first post rather than after?
sweethoney Posted November 17, 2016 Posted November 17, 2016 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..
Nathan Explosion Posted November 17, 2016 Posted November 17, 2016 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.
marklcfc Posted November 17, 2016 Author Posted November 17, 2016 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.
Nathan Explosion Posted November 17, 2016 Posted November 17, 2016 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.
EricT Posted November 17, 2016 Posted November 17, 2016 @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 ?
Nathan Explosion Posted November 17, 2016 Posted November 17, 2016 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.
EricT Posted November 17, 2016 Posted November 17, 2016 Yes, now I remember this post about rotate pictures
marklcfc Posted November 17, 2016 Author Posted November 17, 2016 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
newbie LAC Posted November 20, 2016 Posted November 20, 2016 {{if $_REQUEST['ad_inside_first_post'] = !isset($_REQUEST['ad_inside_first_post']) ? 1 : 0}} {advertisement="inside_first_post"} {{endif}}
marklcfc Posted November 20, 2016 Author Posted November 20, 2016 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.
newbie LAC Posted November 20, 2016 Posted November 20, 2016 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
Nathan Explosion Posted November 20, 2016 Posted November 20, 2016 If only I'd pointed out that issue and a possible fix in my initial post, eh? Glad you have things sorted out anyway.
AlexWebsites Posted January 20, 2017 Posted January 20, 2017 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}?
Apfelstrudel Posted March 30, 2017 Posted March 30, 2017 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?
Apfelstrudel Posted March 30, 2017 Posted March 30, 2017 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.