XF 2.2 Prevent Widget in a node and it's children

eDaddi

Active member
Is there some syntax for the widget display condition to prevent the widget in a certain node and all of its children?
 
From memory, I don't think a parent param is exposed.

You can achieve it though be entering the array of node IDs like so: !in_array($xf.reply.containerKey, ['node-1','node-2']) .

Replace node-1, node-2 as required.
Add others comma separated.
 
I was trying to avoid the array. These nodes are being created by members and I want to avoid having to update that daily.
 
Last edited:
$xf.reply.section would do the trick ...... so I thought. Can you tell me why this works:

Code:
$xf.visitor.isMemberOf([1,3]) AND $xf.reply.section == 'forums'

but this doesn't:
Code:
$xf.visitor.isMemberOf([1,3]) AND !$xf.reply.section == 'snogGroups'
 
You would have to check with the author of the snog groups add-on as that's not core code.
Sorry I should have give more info, I'm not firing on all cylinders this today.....

I can print $xf.reply.section to the screen before and inside the widget and it displays 'snogGroups'.
In the forums it displays 'foums', media gallery displays 'xfmg', resources displays 'xfrm' etc etc...

I know that 'snogGroups' value is in there, I just can't say 'Where $xf.reply.section does not equal it'

I know it's not XF's code, I'm asking why that second conditional may not work. It kills widget from displaying anywhere.
 
You are negating a string and afterwards you are comparing this to another string; this won't work.
simon cowell facepalm GIF


Catching Fire Cheers GIF by The Hunger Games: Mockingjay Part 2
 
Top Bottom