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

XF 1.2 Remove sidebar on certain pages?

Discussion in 'Styling and Customization Questions' started by LurkerLou, Feb 4, 2014.

  1. LurkerLou

    LurkerLou Active Member

    How would I go about removing the sidebar on certain pages. I found out how to do it globally but not on specific pages.

    .sidebar {
    display: none;
    }

    .mainContent {
    margin-right: 0;
    }

    How would I specify a specific page?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Add the page class to the selector, e.g. .forum_list .sidebar

    The FAQ in my signature explains how to check the template name for the page you're on.
     
  3. LurkerLou

    LurkerLou Active Member

    Worked perfectly, @Brogan. The only issue now is how to expand the content. to fill the voided space.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Remove the sidebar div and/or any main content margins using the same method.
     
  5. LurkerLou

    LurkerLou Active Member

    I can't quite get it to work properly. Can you post an example code?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Code:
    .forum_list .sidebar {
    display: none;
    }
    
    .forum_list .mainContent{
    margin-right: 0;
    }
     
  7. LurkerLou

    LurkerLou Active Member

    I'm talking about removing the gap left on the right when removing the sidebar.
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    That's what that code does.

    Code:
    .forum_list .mainContent{
    margin-right: 0;
    }
     
  9. LurkerLou

    LurkerLou Active Member

    Ah. Maybe what I really need to do is remove the user infoblock in the side bar.
    Then it must be an issue with XenPorta. I removed the sidebar but the portal index is still the width it would normally be if there was a sidebar there.
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    You will need to ask in the resource thread for help with that.
     
  11. LurkerLou

    LurkerLou Active Member

    Got it to work. Thanks for the help.
     

Share This Page