We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Two different sidebars
Topic Started: Sep 8 2017, 10:34 PM (153 Views)
spiiike
Member
[ *  *  *  * ]
Board Address: Testing
Board Software: ZetaBoards
Description: I know there's a few ways to add a sidebar but is there a way so that you could have one sidebar content show for guests only and another for members only?
Offline Profile Goto Top
 
l1r72
Member Avatar
Member
[ *  *  * ]
Layout Swap the <!-- BOARD --> tag in your layout for all of this code / Put your sidebar content instead of the * for whatever *
Code:
 
<div id="wrapper">
<div id="sidebar_guests" class="sidebar">* for guests *</div>
<div id="sidebar_members" class="sidebar">* for members *</div>
<div id="wrapper_board">
<!-- BOARD -->
</div>
</div>

<script type="text/javascript">
if($.zb.logged_in != true) {
$('#sidebar_guests').show();
} else if($.zb.logged_in == true) {
$('#sidebar_members').show();
}
</script>


Appearance/CSS
Code:
 

#wrapper { display: table; width: 100%; }
.sidebar, #wrapper_board { display: table-cell; vertical-align: top; }

/*
Sidebar width - the width of the sidebar
Sidebar padding-right - the space between it and the board content (like a margin)
*/

.sidebar {
display: none;
width: 200px;
padding-right: 20px;
}
Edited by l1r72, Sep 8 2017, 10:54 PM.
Offline Profile Goto Top
 
spiiike
Member
[ *  *  *  * ]
Works great thanks :)
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic