XF 2.1 How to show a thread view sidebar widget in a specific forum?

DeltaHF

Well-known member
I want a sidebar widget to be visible when viewing threads in a particular forum.

Using the Display Condition field, I would expect this to show the widget in threads with a node_id of 358:

Code:
$context.thread.node_id == 358

...but that does not work and the widget never displays.

Using an HTML template and dumping the variable confirms that it is, in fact, what I expect it to be. Using this configuration, for example, the widget shows "358" when viewing a thread in the target forum:

199160

But, when we add the Display Condition, the widget disappears from that same thread:

199161

What am I doing wrong?
 
I'm not sure I understand the question.

Your forum is available on multiple subdomains?
My question is - if I make a Xenforo forum avaliable on 2 domains (I ve heard it's possible to add more then one domain to a hosting) is there a code to hide a widget on a subdomain? Or show it as a condition? Like as if I would hide it from a node?
 
Oh. It's definitely possible, but I would strongly advise against doing that, especially if your forum is open to the public due to duplicate content SEO issues.

I think this would do what you want, but I haven't tested it:

Code:
$_SERVER['SERVER_NAME'] == 'subdomain.example.com'
 
Oh. It's definitely possible, but I would strongly advise against doing that, especially if your forum is open to the public due to duplicate content SEO issues.

I think this would do what you want, but I haven't tested it:

Code:
$_SERVER['SERVER_NAME'] == 'subdomain.example.com'
What is server_name?

Also why is it an issue if it has duplication? It's just a widget, no?
 
What is server_name?
Don't change that. See:


Also why is it an issue if it has duplication? It's just a widget, no?
It has nothing to do with the widget. This can cause SEO issues if not handled carefully.

 
Top Bottom