Resource icon

[bd] Widget Framework 2.6.6

No permission to download
OK, in the latest version, I see that xfrocks leaves this note
XenForo_Template_Helper_Core::helperIsMemberOf($visitor, 3) -- means: show the widget for users of user group #3 only.

What if I want a negate of that, show the widget if they are not in usergroup #3 only

And how to show widgets only to usergroups x,y,z only?
 
What if I want a negate of that, show the widget if they are not in usergroup #3 only
Code:
XenForo_Template_Helper_Core::helperIsMemberOf($visitor, 3) == false

And how to show widgets only to usergroups x,y,z only?
Code:
XenForo_Template_Helper_Core::helperIsMemberOf($visitor, x)
OR XenForo_Template_Helper_Core::helperIsMemberOf($visitor, y)
OR XenForo_Template_Helper_Core::helperIsMemberOf($visitor, z)
 
Excellent. Thanks very much.

I think you should add a few of these on the first post or inside the addon. I have seen many questions on conditionals so it would be good to have some FAQ to cover the topic.

The next one:
How to display a widget on forumid X, Y, Z?
How to display a widget if they are not under X, Y, Z?
Can we use categoryid instead? That way, show widget under category X would cover all the forums under this category.
Thanks
 
Excellent. Thanks very much.

I think you should add a few of these on the first post or inside the addon. I have seen many questions on conditionals so it would be good to have some FAQ to cover the topic.
That's good advice, I will put it somewhere.

How to display a widget on forumid X, Y, Z?
You need to use forum_view position:
Code:
in_array($forum['node_id'], array(X, Y, Z))

How to display a widget if they are not under X, Y, Z?
Also need to use forum_view:
Code:
in_array($forum['node_id'], array(X, Y, Z)) == false

Can we use categoryid instead? That way, show widget under category X would cover all the forums under this category.
Need to use forum_view:
Code:
$forum['parent_node_id'] == $categoryid
 
That's good advice, I will put it somewhere.


You need to use forum_view position:
Code:
in_array($forum['node_id'], array(X, Y, Z))


Also need to use forum_view:
Code:
in_array($forum['node_id'], array(X, Y, Z)) == false


Need to use forum_view:
Code:
$forum['parent_node_id'] == $categoryid
Lot of good tips.
I mean to ask how to show widgets on sidebar of threads (thread_view) that are under forums X, Y, Z.
 
Oh, those 3 conditions can be use in thread_view too.
I'm making great progress, thanks to your tips on these conditions.
1) How do I negate this condition i.e showing when it's not under this category
Code:
$forum['parent_node_id'] == $categoryid
2) I notice that if I have this structure
Category A (id 1)
--Forum B (id 2)
-----Subforum 1
-----Subforum 2

Then to use the condition like in 1) I can't just use category id A but have to include forumid B for it to work for threads in subforum 1 and 2. It appears only threads that directly under will take this condition.
So, to hide a widget for all threads in subforum 1 and 2, this is the condition I use
in_array($forum['parent_node_id'], array(1, 2)) == false instead of using only id from category A.

3) Using the above condition and this position list EWRporta_Portal,forum_list,thread_view I will get error "Undefined variable: forum" on the forum home.
 
I'm making great progress, thanks to your tips on these conditions.
1) How do I negate this condition i.e showing when it's not under this category
Code:
$forum['parent_node_id'] == $categoryid
Code:
$forum['parent_node_id'] != $categoryid

2) I notice that if I have this structure
Category A (id 1)
--Forum B (id 2)
-----Subforum 1
-----Subforum 2

Then to use the condition like in 1) I can't just use category id A but have to include forumid B for it to work for threads in subforum 1 and 2. It appears only threads that directly under will take this condition.
So, to hide a widget for all threads in subforum 1 and 2, this is the condition I use
in_array($forum['parent_node_id'], array(1, 2)) == false instead of using only id from category A.
Yes, you are correct.

3) Using the above condition and this position list EWRporta_Portal,forum_list,thread_view I will get error "Undefined variable: forum" on the forum home.
You can not use $forum in EWRporta_Portal.
 
You can not use $forum in EWRporta_Portal.
I tried different things for postion
1) All
This will result in same error on every thread sidebar.
2) forum_list, thread_view
This will result in same error on forum index.

So I guess the solution is to create a duplicate widget for the EWRporta and forum home. Can't use one for everything I guess ;)
 
I tried different things for postion
1) All
This will result in same error on every thread sidebar.
2) forum_list, thread_view
This will result in same error on forum index.

So I guess the solution is to create a duplicate widget for the EWRporta and forum home. Can't use one for everything I guess ;)
Ah, you can't use $forum in forum_list either. You can add more condition to make it works in all kind of templates but it's not good practice I think. Unless you really want to use the same widget...
 
All I want is to NOT show the sidebar banner to my paying students in threads under private forums :)
Not sure if there is a much simpler way to go.
If I use usergroup condition, they can't see the banner in the public threads.
 
All I want is to NOT show the sidebar banner to my paying students in threads under private forums :)
Not sure if there is a much simpler way to go.
If I use usergroup condition, they can't see the banner in the public threads.
So you want to show the banner everywhere except in private forums?
 
Thank you very much. It works again.
I'm really impressed with how powerful and flexible your add on is. I think more documentation will help people unleash more power from it.
 
Thanks for the continuous updates XFRocks. Very happy with it.

One thing though are the conditionals. Can they be completely disabled somewhere as I prefer to set my own via the templates I call them from. Now they are overruled it seems.
 
Thanks for the continuous updates XFRocks. Very happy with it.

One thing though are the conditionals. Can they be completely disabled somewhere as I prefer to set my own via the templates I call them from. Now they are overruled it seems.
If you don't want to use the conditions, just leave it empty.
 
I use the conditionals in the normal template but when i leave the box empty it shows the widget to all users and not longer just to the groups I described in the template :)
 
I use the conditionals in the normal template but when i leave the box empty it shows the widget to all users and not longer just to the groups I described in the template :)
What is your template <xen:if /> and what is the condition in the widget? I assume you are trying to use the HTML renderer?
 
Top Bottom