1. 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?

Discussion in 'Styling and Customization Questions' started by JABRONI, Aug 31, 2013.

  1. JABRONI

    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?
     
  2. DRE

    DRE Well-Known Member

  3. JABRONI

    JABRONI Well-Known Member

    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?
     
  4. DRE

    DRE Well-Known Member

    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.
     
  5. JABRONI

    JABRONI Well-Known Member

    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?
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    You need to use $visitor. Not $user.
     
  7. JABRONI

    JABRONI Well-Known Member

    I tried that also; it still didn't work.
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    $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?
     
  9. JABRONI

    JABRONI Well-Known Member

    Custom Field:

    [​IMG]

    [​IMG]

    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.
     
  10. Chris D

    Chris D XenForo Developer Staff Member

    Code:
    <xen:if is="{$visitor.customFields.taigachat} == 'off'"> <xen:else /><xen:include template="dark_taigachat_full" /></xen:if>
    This one should definitely work...
     
  11. JABRONI

    JABRONI Well-Known Member

    where should I try to put it?
     
  12. DRE

    DRE Well-Known Member

    Do you use a template edit to display taigachat, or bd widget framework or xenporta?
     
  13. JABRONI

    JABRONI Well-Known Member

    I use Widget Framework, yeah
     
  14. DRE

    DRE Well-Known Member

    No wonder. Just do it manually in your forum_list template.
     
  15. DRE

    DRE Well-Known Member

    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>
    
     
    Chris D likes this.
  16. JABRONI

    JABRONI Well-Known Member

    This didn't work either, sadly enough. I'm just going to write it off as impossible haha. Thanks anyways!
     
  17. DRE

    DRE Well-Known Member

    works for me?
     
  18. JABRONI

    JABRONI Well-Known Member

    I'm not sure if this has anything to do with it not working, but only a certain usergroup can see Taigachat. Would that change anything?
     
  19. DRE

    DRE Well-Known Member

    Actually it's not working for me either.
     
  20. DRE

    DRE Well-Known Member

    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>
     

Share This Page