XF 2.0 Adsense after first and last post

You can use the advertising system in XF2 to put the ads in one of the message related positions. You can wrap your ad code in conditionals, similar to the ones you likely used in XF1.
 
You can use the advertising system in XF2 to put the ads in one of the message related positions. You can wrap your ad code in conditionals, similar to the ones you likely used in XF1.
Hm, if I wrap ad code to this conditional in advertising widget position Post: Below message content I get error:

Code:
<xf:if is="$post.position % $xf.options.messagesPerPage == 9">
    Some content...
</xf:if>

What am I doing wrong?
 
Hm, it works now, but I got this:

Server error log

  • XF\PrintableException: Line 22: Expected valid expression.
  • src/XF/Mvc/Entity/Entity.php:1083
  • Generated by: ...
  • 19. dec 2017 ob 22:07
Stack trace
#0 src/XF/Service/Advertising/Writer.php(84): XF\Mvc\Entity\Entity->save()
#1 src/XF/Repository/Advertising.php(70): XF\Service\Advertising\Writer->write()
#2 src/XF/Entity/Advertising.php(37): XF\Repository\Advertising->writeAdsTemplate()
#3 src/XF.php(244): XF\Entity\Advertising->XF\Entity\{closure}()
#4 src/XF/Mvc/Dispatcher.php(137): XF::triggerRunOnce(true)
#5 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#7 src/XF.php(328): XF\App->run()
#8 admin.php(13): XF::runApp('XF\\Admin\\App')
#9 {main}

-----------------

Maybe it's temporary, because it works now with no error.
 
Back
Top Bottom