XF 1.2 Class for logged in vs not logged in?

Neil E.

Active member
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?


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

Have you tried using a visitor conditional?

Jake Bunce

XenForo moderator
Staff member
This should work:

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

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