This would be extremely useful to have for Resource disussion threads! It'd be great to prompt the user for the version number of the resource they're using, or at least a way to fill in some sort of bug report template.
Ended up just hardcoding conditionals like @Brogan suggested, I'll just have to remember to do this for every resource forum I add, with a fallback in case I add it to the array but forget to set the category ID. Thanks for your help!
Added to forum_view template:
<xf:pageaction...
Learned about {{ dump(vars()) }} which has helped a lot. Forums don't seem have a reference to resource categories (as far as I can tell), but resource categories do have a reference to their linked forums. If I could iterate through that I could probably figure out how to set this up nicely...
Got it to work with this, since using $__globals just gives null
<xf:pageaction if="$xf.visitor.canAddResource() AND in_array($forum.node_id, [11,12])">
<xf:button href="{{ link('resources/add') }}" class="button--cta" icon="write" overlay="true">{{ phrase('xfrm_add_resource...')...
People who are going to be joining my forum won't have much experience with forums, and even less experience dealing with XenForo resources. I have some forums set up where users can't directly make threads in, but if they create a resource, then it will automatically generate a discussion...