1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

$post.post_id}, array not working, what could it be?

Discussion in 'XenForo Development Discussions' started by Donny, Jun 12, 2015.

  1. Donny

    Donny Active Member

    Hi,

    I'm struggling to get this to work, for some reason.

    <xen:if is="{$post.post_id} == 5">
    <style type="text/css">
    .overtaking-top-dynamic {
    width: 320px;
    height: 50px;
    }

    @media(min-width: 490px) {
    .overtaking-top-dynamic {
    width: 336px;
    height: 280px;
    }
    }
    </style>

    <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- XXXXXXX -->
    <ins class="adsbygoogle overtaking-top-dynamic"
    style="display:inline-block"
    data-ad-client="XXXXXXXX"
    data-ad-slot="XXXXXX"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    </xen:if>

    The post ID or an array version just doesn't want to load.
    I can load the first post only version. That's running fine. Also 'with less than' 15 posts works fine too.
    It just seems to be post ID related conditionals that aren't working.

    What could the reason be?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    What template is that code being added to?

    If it's a container template, e.g. PAGE_CONTAINER (or similar) it's likely that it won't have access to the $post param.
     
    MatthewH and Donny like this.

Share This Page