Resource icon

[bd] Widget Framework 2.6.6

No permission to download
I would like to add a side bar widget to a specific category. I would like for this widget to show only for this category and all node topics within.
this category is called "San Diego Long Range"
It appears the hook is hook_age_container_sidebar

what would the exact expression be as I keep messing it up? thanks
 
Last edited:
Is there something I can enter in the "Expression" box so that a widget will only display to members who do not have an avatar set?

A lot of my members don't have an avatar, so I am trying to create a widget that will target them and help them set one. :)

Thanks.

I just followed @Brogan guide here and tried putting this in the Expression box:

PHP:
!{$visitor.avatar_date} AND !{$visitor.gravatar}

...but it doesn't seem to work. :( I've tried it with and without surrounding " but no change. Is there anything else I can try?

Hmm. Just spotted some server errors in my logs, which I think were caused by my attempts at this conditional. This was when I tried it with quotation marks around the expression:

Code:
Server Error Log
Error Info
ErrorException: Fatal Error: syntax error, unexpected '.', expecting '}' - library/WidgetFramework/WidgetRenderer.php(482) : runtime-created function:1
Generated By: test, 25 minutes ago
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
["url"] => string(58) "http://www.mydomain.com/xf/index.php?members/test.84/"
["_GET"] => array(1) {
["members/test_84/"] => string(0) ""
}
["_POST"] => array(0) {
}
}

And this is the error when I used it without quotation marks:

Code:
Server Error Log
Error Info
ErrorException: Fatal Error: syntax error, unexpected '{' - library/WidgetFramework/WidgetRenderer.php(482) : runtime-created function:1
Generated By: test, 28 minutes ago
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
["url"] => string(58) "http://www.mydomain.com/xf/index.php?members/test.84/"
["_GET"] => array(1) {
["members/test_84/"] => string(0) ""
}
["_POST"] => array(0) {
}
}

Which makes me wonder, should I just substitute the curly brackets for square brackets, I wonder? I might try that later if I'm feeling brave!

Any suggestions, @xfrocks ? Thanks. :)
 
I think I've found a couple of bugs.

  1. When using Clear Sidebar Widget on a page with "hide visitor panel too?" unticked and not using any other widgets, the visitor panel does not appear. It will only appear if you add another widget.
  2. The enable/disable widget tick option does not work as expected. All of my widgets are used on multiple positions (forum_list, member_notable etc). To test something, I unticked all widgets listed under forum_list. I expected the widgets to be disabled on that page but active on all other pages. Unticking didn't do anything, the widgets remained active on forum_list. I can only disable a widget using the tick option if it is used on a single page.
 
I think I've found a couple of bugs.

  1. When using Clear Sidebar Widget on a page with "hide visitor panel too?" unticked and not using any other widgets, the visitor panel does not appear. It will only appear if you add another widget.
  2. The enable/disable widget tick option does not work as expected. All of my widgets are used on multiple positions (forum_list, member_notable etc). To test something, I unticked all widgets listed under forum_list. I expected the widgets to be disabled on that page but active on all other pages. Unticking didn't do anything, the widgets remained active on forum_list. I can only disable a widget using the tick option if it is used on a single page.
For number 1, if you only have the Clear widget, the sidebar is technically empty therefore the visitor panel will not show up. It's unclear what you are trying to do here but if you must have visitor panel (and only visitor panel), you can use Clear widget (with hide visitor panel checked) + Visitor Panel widget.

For number 2, it is not possible to disable widget for one position but keep it active for other. It's a bit tricky for the toggler to work in multiple-positions situation. I will see what I can do.
 
For number 1, if you only have the Clear widget, the sidebar is technically empty therefore the visitor panel will not show up. It's unclear what you are trying to do here but if you must have visitor panel (and only visitor panel), you can use Clear widget (with hide visitor panel checked) + Visitor Panel widget.

For number 2, it is not possible to disable widget for one position but keep it active for other. It's a bit tricky for the toggler to work in multiple-positions situation. I will see what I can do.
Thanks.

I was just testing an issue for someone and noticed that with the clear sidebar only that the visitor panel didn't appear, so when I added a visitor panel widget there were then two. It might be worth a note in the Clear Sidebar widget that this is intended.

If the toggler can't toggle a widget that is in multiple positions, mightn't it be best to just remove the toggle altogether? It would save confusion and it's a simple matter to click on the dropdown and choose Disable/Enable instead.
 
Heya, is there any news on the Recent Status block fixed? Something is seriously wrong i even re-uploaded the files and imported the XML file again but still the block feels broken.
 
@xfrocks it's displaying the 1.4 features now. Only not displaying the User > User posts still.

Btw i'm having one issue when adding a new widget, the ajax is not loading when we choose a widget to load its options! (this on google chrome)
 
  • Like
Reactions: rdn
You should use this for the Expression:

PHP:
!$visitor['avatar_date'] AND !$visitor['gravatar']
Please add this to your FAQ page for other people reference :)

Btw i'm having one issue when adding a new widget, the ajax is not loading when we choose a widget to load its options! (this on google chrome)
Same issue here, Chromium 37 Ubuntu.
Have to save to appear all other fields.
 
That has worked a treat, thanks. :)
You should probably also put $visitor['user_id'] > 0 in the expression, so guests don't see the avatar suggestion widget.

So...

PHP:
$visitor['user_id'] > 0 AND !$visitor['avatar_date'] AND !$visitor['gravatar']
 
You should probably also put $visitor['user_id'] > 0 in the expression, so guests don't see the avatar suggestion widget.

So...

PHP:
$visitor['user_id'] > 0 AND !$visitor['avatar_date'] AND !$visitor['gravatar']
Good catch - just tested with and without and you're bang on. Thanks very much. :)
 
@xfrocks it's displaying the 1.4 features now. Only not displaying the User > User posts still.

Btw i'm having one issue when adding a new widget, the ajax is not loading when we choose a widget to load its options! (this on google chrome)
Try refresh JavaScript cache maybe?
 
Try refresh JavaScript cache maybe?
I did, it's still the same. Widget Framework disabled:
chV0vXP.png


Framework active sidebar:
9JcaAEX.png


Editing the sidebar options, adding a new one, etc.. etc.. Nothing i tried makes the User > User posts display on the Recent Status widget.
 
Oh gawd, why nobody told me?! Okay now @xfrocks only need to poke the ajax load of the widget options because i can't get past it.
I think i will try on other browsers.
Ah, I didn't know you were still using Recent Status. Sorry :P Regarding the options thing, have you tried clearing the JavaScript cache?
 
Top Bottom