• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 I want to hide a certain part of the forum; how do I do that?

JABRONI

Well-known member
#1
I want to add the option to turn on/off Taigachat with a Yes/No option in Preferences. I've tried this code,

Code:
<xen:if is="{$user.customFields.testfield.no}">
#taigachat_full {
display: none !important;
}
</xen:if>
but that didn't work. Any help?
 

JABRONI

Well-known member
#3
I tried,

Code:
<xen:if is="{$user.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_chatbox" /></xen:if>
Code:
<xen:if is="{$user.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_full" /></xen:if>
Code:
<xen:if is="{$user.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_" /></xen:if>
none of those worked ;_;

@Luke Foreman could you possibly chime in?
 

DRE

Well-known member
#4
Did you do step 5?

Step 5.

For Meebo Bar Always On:

In AdminCP go to Users/User Customization/Custom User Fields/Create New Field

- Basic Information Tab -

Field ID: meebo
Title: Meebo Chat Bar
Description: Select 'off' to disable the Meebo Chat Bar.
Display Location: Preferences
Display Order: 1
Field Type: Radio Buttons
- Options for Choice Fields Tab -
Possible Choices: Put the word 'off' in both boxes.
General Options: Only 'User editable' should be checked.
 

JABRONI

Well-known member
#5
Did you do step 5?

Step 5.

For Meebo Bar Always On:

In AdminCP go to Users/User Customization/Custom User Fields/Create New Field

- Basic Information Tab -

Field ID: meebo
Title: Meebo Chat Bar
Description: Select 'off' to disable the Meebo Chat Bar.
Display Location: Preferences
Display Order: 1
Field Type: Radio Buttons
- Options for Choice Fields Tab -
Possible Choices: Put the word 'off' in both boxes.
General Options: Only 'User editable' should be checked.
Yeah, I already had a Custom Field setup pretty much just like it. Even changed it to Radio Buttons to make it just like that, but it still didn't work. Maybe it's because Taigachat uses multiple templates?
 

Chris D

XenForo developer
Staff member
#6
I tried,

Code:
<xen:if is="{$user.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_chatbox" /></xen:if>
Code:
<xen:if is="{$user.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_full" /></xen:if>
Code:
<xen:if is="{$user.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_" /></xen:if>
none of those worked ;_;

@Luke Foreman could you possibly chime in?
You need to use $visitor. Not $user.
 

Chris D

XenForo developer
Staff member
#8
$visitor is definitely correct.

So you need to be a bit more detailed.

What template are you putting the code in? Where in the template? What type of user field have you created?
 

JABRONI

Well-known member
#9
$visitor is definitely correct.

So you need to be a bit more detailed.

What template are you putting the code in? Where in the template? What type of user field have you created?
Custom Field:





I've tried putting the code in Extra.css, very bottom of page_container_js_body, and above the last /body tag on page_container.
 

Chris D

XenForo developer
Staff member
#10
Code:
<xen:if is="{$visitor.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_full" /></xen:if>
This one should definitely work...
 

DRE

Well-known member
#15
Code:
<xen:hook name="forum_list_nodes">
<xen:if is="{$visitor.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_full" /></xen:if>
<xen:if is="{$renderedNodes}"><xen:include template="node_list" /></xen:if>
</xen:hook>
 

JABRONI

Well-known member
#16
Code:
<xen:hook name="forum_list_nodes">
<xen:if is="{$visitor.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_full" /></xen:if>
<xen:if is="{$renderedNodes}"><xen:include template="node_list" /></xen:if>
</xen:hook>
This didn't work either, sadly enough. I'm just going to write it off as impossible haha. Thanks anyways!
 

DRE

Well-known member
#20
actually I got it to work now. I forgot i had taigachat on in my xenporta.

Don't forget to delete your taigachat widget in Widget Framework and Xenporta.

So yeah this is the code you'll use in forum_list

<xen:hook name="forum_list_nodes">
<xen:if is="{$visitor.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_full" /></xen:if>
<xen:if is="{$renderedNodes}"><xen:include template="node_list" /></xen:if>
</xen:hook>