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

XF 1.2 Class for logged in vs not logged in?

Neil E.

Active member
#1
I have modified sidebar content that changes position when viewing the list of forum topics based on whether the user is logged in or not.

My content is positioned correctly when logged in (top of sidebar level with top of main content). This is because the main content is moved down by the presence of pageNavLinkGroup. When not logged in, pageNavLinkGroup is gone and my sidebar looks too low because the main content moves up.

CSS would be nice, but I doubt it exists:
.forum_view .sidebar .loggedin
{margin-top: 30px}


.forum_view .sidebar .notloggedin
{margin-top: 10px}


How is this normally done?
 

Brogan

XenForo moderator
Staff member
#2
The .LoggedIn class exists but it is JavaScript.

Have you tried using a visitor conditional?
 

Jake Bunce

XenForo moderator
Staff member
#4
This should work:

Code:
html.LoggedIn .forum_view .sidebar
{
	margin-top: 30px;
}

html.LoggedOut .forum_view .sidebar
{
	margin-top: 10px;
}