Surendra.S Posted January 28, 2018 Share Posted January 28, 2018 Hi All, I need to place some AD after first post of a topic, and I could find that there is a Custom Location built for that - "After the first post in each topic". The problem is that it places the AD in EACH page of topic (after first post in each page), but I need to place it only in 1st page. How to do that ? When I go to topic template bit and see the code, its below : {{if $postCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_topic_view' )}} {$advertisement|raw} {{endif}} Above code is checking only for FIRST POST, but not for the FIRST PAGE. I need the IF condition to find out if its FIRST PAGE or not ? Kindly assist. Link to comment Share on other sites More sharing options...
Surendra.S Posted January 29, 2018 Author Share Posted January 29, 2018 any help guys ? Link to comment Share on other sites More sharing options...
newbie LAC Posted January 30, 2018 Share Posted January 30, 2018 Hello, On 28.01.2018 at 11:54 PM, Surendra.S said: I need the IF condition to find out if its FIRST PAGE or not ? {{if !isset(request.page) or request.page == 1}} First page {{endif}} Link to comment Share on other sites More sharing options...
Surendra.S Posted January 30, 2018 Author Share Posted January 30, 2018 13 hours ago, newbie LAC said: Hello, {{if !isset(request.page) or request.page == 1}} First page {{endif}} Thank You sooooo much Sir. That worked like a charm. I was searching for this code for long time. Now I could place the AD in first post of first page of topic. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.