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

JABRONI

Well-known member
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?
 

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?
 
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.
 
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?
 
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.
 
$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?
 
$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:

4fCMA.png


4fCOz.png


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.
 
Code:
<xen:if is="{$visitor.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_full" /></xen:if>
This one should definitely work...
 
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>
 
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!
 
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>
 
Back
Top Bottom