XF 1.3 Conditionals Question

thunderup

Active member
I want to have a conditional to not show something on specific templates AND specific nodes at the same time... How would I accomplish this?
 
This is what I have...

Code:
<xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook', 'register_twitter', 'register_google', 'login', 'error_with_login', 'contact')) AND !in_array({$forum.node_id}, array('node-83'))">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Forum Footer -->
<ins class="adsbygoogle" style="display:inline-block;width:970px;height:90px" data-ad-client="ca-pub-2735863251480471" data-ad-slot="6136959148"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</xen:if>

But it's still showing on node 83, what do I have incorrectly input?

Thanks @Brogan
 
Change node-83 to 83.

I made it this:

Code:
<xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook', 'register_twitter', 'register_google', 'login', 'error_with_login', 'contact')) AND !in_array({$forum.node_id}, array('83'))">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Forum Footer -->
<ins class="adsbygoogle" style="display:inline-block;width:970px;height:90px" data-ad-client="ca-pub-2735863251480471" data-ad-slot="6136959148"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</xen:if>

Still showing up though on node 83 (which is a page node for privacy policy)
 
I just did this on forum node #4

Code:
<xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook', 'register_twitter', 'register_google', 'login', 'error_with_login', 'contact')) AND !in_array({$forum.node_id}, array(4))">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Forum Footer -->
<ins class="adsbygoogle" style="display:inline-block;width:970px;height:90px" data-ad-client="ca-pub-2735863251480471" data-ad-slot="6136959148"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</xen:if>

It worked.. does it make a difference that the node I'm trying to remove it from is a page node?
 
You're trying to use $forum.node_id for a page node.

Try using $page.node_id, or $quickNavSelected (e.g. !in_array({$quickNavSelected}, array('node-83')).
 
Top Bottom