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

XF 1.2 sidebar width

Discussion in 'XenForo Questions and Support' started by ld762, Dec 13, 2013.

  1. ld762

    ld762 Member

    I know the SideBar width can be adjusted in the ACP but is it possible to change it programmatically?

    I saw the code below in the "move sidebar to the left" article so I am thinking it could be done. But not sure how since I don't know the correct reference for the PHP variable.

    float: right;
    margin-left: -{xen:calc '@sidebar.width + 10'}px;
    margin-right: 0px;
    width: 100%;
  2. Brogan

    Brogan XenForo Moderator Staff Member

    What is it you're trying to do exactly?
    Some more context may help.

    The variable above is actually a style property - they can be used in templates like that.
  3. ld762

    ld762 Member

    The default sidebar is set to 250 on one particular page, I'd like to set it to something smaller say 200.
    So the width would change depending on the current page. Would that be possible?
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Use specificity in EXTRA.css for each page.
    For example, this will just affect the sidebar on the main forum list page.
    .forum_list .sidebar {
    width: 200px;
  5. ld762

    ld762 Member

    lol... I shoulda thought of that. Thanks!

Share This Page