Jump to content

Display AD after first post of first page of topic ?


Surendra.S
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...