Veer Well-known member Feb 25, 2011 #1 Hi guys, Is there a way to hide signatures from a few Forum IDs? I found the following but that doesn't help: Code: <xen:if is="{$forum.node_id}==x"> Code for forum x </xen:if> I want to completely disable signatures from a few forums, hope somebody knows a way. Thanks.
Hi guys, Is there a way to hide signatures from a few Forum IDs? I found the following but that doesn't help: Code: <xen:if is="{$forum.node_id}==x"> Code for forum x </xen:if> I want to completely disable signatures from a few forums, hope somebody knows a way. Thanks.
O onyxchase Active member Feb 25, 2011 #2 Code: <xen:if is="{$forum.node_id} != 5 OR {$forum.node_id} != 6"> Not sure if this would work? Upvote 0 Downvote
Veer Well-known member Feb 25, 2011 #3 onyxchase said: Code: <xen:if is="{$forum.node_id} != 5 OR {$forum.node_id} != 6"> Not sure if this would work? Click to expand... No, it doesn't work. P.S. It works when you only add this for a single node: {$forum.node_id} != 5 but when you put "{$forum.node_id} != 5 OR {$forum.node_id} != 6" it doesn't. Upvote 0 Downvote
onyxchase said: Code: <xen:if is="{$forum.node_id} != 5 OR {$forum.node_id} != 6"> Not sure if this would work? Click to expand... No, it doesn't work. P.S. It works when you only add this for a single node: {$forum.node_id} != 5 but when you put "{$forum.node_id} != 5 OR {$forum.node_id} != 6" it doesn't.
O onyxchase Active member Feb 25, 2011 #4 Maybe it's || instead of OR? Sorry I haven't played much with the templates. Upvote 0 Downvote
Veer Well-known member Feb 25, 2011 #5 onyxchase said: Maybe it's || instead of OR? Sorry I haven't played much with the templates. Click to expand... Nope but it works with && Thanks anyway Upvote 0 Downvote
onyxchase said: Maybe it's || instead of OR? Sorry I haven't played much with the templates. Click to expand... Nope but it works with && Thanks anyway
J James Well-known member Feb 25, 2011 #6 Try using in_array() and checking the contents of the array in the conditional to exclude forum ids. Upvote 0 Downvote
Jake Bunce Well-known member Feb 25, 2011 #7 James said: Try using in_array() and checking the contents of the array in the conditional to exclude forum ids. Click to expand... Oh yay! When did they add this? Array functions didn't work the last time I tested it. This is the complete conditional code for people who are interested: Code: <xen:if is="!in_array({$forum.node_id}, array(5,6))"> THIS CODE WILL SHOW IN ALL FORUMS EXCEPT 5 AND 6 </xen:if> Veer said: No, it doesn't work. P.S. It works when you only add this for a single node: {$forum.node_id} != 5 but when you put "{$forum.node_id} != 5 OR {$forum.node_id} != 6" it doesn't. Click to expand... That expression is logically always true. That is the problem. Use my code above. Upvote 0 Downvote
James said: Try using in_array() and checking the contents of the array in the conditional to exclude forum ids. Click to expand... Oh yay! When did they add this? Array functions didn't work the last time I tested it. This is the complete conditional code for people who are interested: Code: <xen:if is="!in_array({$forum.node_id}, array(5,6))"> THIS CODE WILL SHOW IN ALL FORUMS EXCEPT 5 AND 6 </xen:if> Veer said: No, it doesn't work. P.S. It works when you only add this for a single node: {$forum.node_id} != 5 but when you put "{$forum.node_id} != 5 OR {$forum.node_id} != 6" it doesn't. Click to expand... That expression is logically always true. That is the problem. Use my code above.
Veer Well-known member Feb 26, 2011 #8 Very well Jake, it works perfectly. Thank you so much. Upvote 0 Downvote