Resource icon

[bd] Widget Framework 2.6.6

No permission to download
Anyone have issues with the sort order? On my widget page in the main column, the interface looks one way, then on the site another.
 
Looking for a quick solution on getting an expression ( hook:ad_above_content ) to work within a CATEGORY vs. FORUM. What I am currently doing with certain forums is displaying a banner with the expression above and

$visitor['user_id'] != 0
AND
in_array($forum['node_id'], array(205,206,207))

My problem is that I would like to use this within a Category buy can't seem to find the right " in_array" or expression that works congruently with displaying within a Category.

Here is an image to kind of give you an idea.

5407051591450624.png


This would be the Category. As you can see no banner.. Using the array above for the forum " General Discussion " within this category, I can easily get the banner to display.

6346753794375680.png


Is there any expression I can use to get a banner displayed within a Category? I appreciate the help guys, this has been bugging me for a few months now.
 
Hmm, what? $category['node_id'] didn't work? Is this conditionals in template or conditionals in widget? You can use the style editor or something of this add-on to check existing variables for the current page.
 
Does anyone know how to have an array for contentemplate for templates NOT in the list?

!in_array($contentTemplate, array('thread_view', 'account_wrapper'))

Doesn't seem to work on the new setup.
 
Looking for a quick solution on getting an expression ( hook:ad_above_content ) to work within a CATEGORY vs. FORUM. What I am currently doing with certain forums is displaying a banner with the expression above and

$visitor['user_id'] != 0
AND
in_array($forum['node_id'], array(205,206,207))

My problem is that I would like to use this within a Category buy can't seem to find the right " in_array" or expression that works congruently with displaying within a Category.
Your requirement is a bit complicated so the expression will be quite complicated, like this:

Code:
$visitor['user_id'] != 0
AND
in_array($contentTemplate, array('forum_view', 'category_view'))
AND
preg_match('/^node(205|206|207)($|\s)/', $bodyClasses)

The reason is $category variable is not available in the PAGE_CONTAINER template (where the hook ad_above_content is used) so you can't use that variable. Fortunately XenForo make uses of $bodyClasses so we need to use it here. Put your node ids (both forums and categories) in the preg_match pattern.
 
  • Like
Reactions: rdn
Does anyone know how to have an array for contentemplate for templates NOT in the list?

!in_array($contentTemplate, array('thread_view', 'account_wrapper'))

Doesn't seem to work on the new setup.
That should work. Are you on stable or beta version?
 
Beta, I'll try again when I get back but if I remember it kept saying invalid expression.
That won't work for beta, you need to change it to this

Code:
!in_array({$contentTemplate}, {xen: array '0=thread_view', '1=forum_view'})

Please note that you can't use account_wrapper to check because it is just a wrapper and $contentTemplate will be set to the inner one (e.g. account_preferences)
 
Your requirement is a bit complicated so the expression will be quite complicated, like this:

Code:
$visitor['user_id'] != 0
AND
in_array($contentTemplate, array('forum_view', 'category_view'))
AND
preg_match('/^node(205|206|207)($|\s)/', $bodyClasses)

The reason is $category variable is not available in the PAGE_CONTAINER template (where the hook ad_above_content is used) so you can't use that variable. Fortunately XenForo make uses of $bodyClasses so we need to use it here. Put your node ids (both forums and categories) in the preg_match pattern.

You sir are a genious! Thank you for taking the time to help me figure that one out.
 
  • Like
Reactions: rdn
Does anyone know how to make a widget appear in a footer section? For example, I am using an Audention/ThemeHouse theme and wish to show the Forum Stats widget in one of my footer sections.

Appreciate any help or answers. :)
 
Does anyone know how to make a widget appear in a footer section? For example, I am using an Audention/ThemeHouse theme and wish to show the Forum Stats widget in one of my footer sections.

Appreciate any help or answers. :)
Create and insert your custom hook manually.
 
Hi guys! I was looking for an addon like this! Thank you xfrocks! But, for xenForo 1.5 which version should I install? 2.5.9 or 2.6.3 beta?
There will be an official update?
Thank you all! :)
 
Does anyone know how to make a widget appear in a footer section? For example, I am using an Audention/ThemeHouse theme and wish to show the Forum Stats widget in one of my footer sections.

Appreciate any help or answers. :)
Create and insert your custom hook manually.
The forum stats widget needs a custom hook?
It depends, if you can use one of the existing hook then feel free to use it (e.g. you can use "footer" or "footer_after_copyright"). Otherwise put something like this in the footer template:
Code:
<xen:hook name="my_awesome_custom_footer" />
...and use it in the widget.
 
  • Like
Reactions: rdn
Top Bottom