Surendra.S Posted January 28, 2018 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.
newbie LAC Posted January 30, 2018 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}}
Surendra.S Posted January 30, 2018 Author 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.