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

eDaddi

Member
Is there some syntax for the widget display condition to prevent the widget in a certain node and all of its children?
 

Brogan

XenForo moderator
Staff member
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.
 

eDaddi

Member
$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'
 

eDaddi

Member
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.
 

eDaddi

Member
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