• 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

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

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

Brogan

XenForo moderator
Staff member
#2
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
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?
 

Brogan

XenForo moderator
Staff member
#4
Use specificity in EXTRA.css for each page.
For example, this will just affect the sidebar on the main forum list page.
Code:
.forum_list .sidebar {
width: 200px;
}