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

Displaying staff side by side?

Discussion in 'XenForo Questions and Support' started by Nasr, Nov 18, 2010.

  1. Nasr

    Nasr Well-Known Member

    How do I display staff side by side? I've removed avatars and titles and would like to display staff side by side instead of on top of each other.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. Nasr

    Nasr Well-Known Member

    That code did not work at all. It outputs some HTML. Plus, I dont want to use avatars. I want to use Usernames instead seperated by commas just like the members online.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I played with the code and achieved this:

    Screen shot 2010-11-18 at 1.01.57 PM.png

    You can see it looks just like the list of regular users. However, I can't find a count for the number of staff so you end up with a trailing comma after the last staffer (unless all online users are staff like in my picture).

    I edited this template:

    Admin CP -> Appearance -> Templates -> sidebar_online_users

    Replace this code:

    Code:
    <xen:if hascontent="true">
    	<div class="section staffOnline avatarList">
    		<div class="secondaryContent">
    			<h3>{xen:phrase staff_online_now}</h3>
    			<ul>
    				<xen:contentcheck>
    					<xen:foreach loop="$onlineUsers.records" value="$user">
    						<xen:if is="{$user.is_moderator} OR {$user.is_admin}">
    							<li>
    								<xen:avatar user="$user" size="s" img="true" />
    								<a href="{xen:link members, $user}" class="username">{xen:helper richUserName, $user}</a>
    								<div class="userTitle">{xen:helper userTitle, $user}</div>
    							</li>
    						</xen:if>
    					</xen:foreach>
    				</xen:contentcheck>
    			</ul>
    		</div>
    	</div>
    </xen:if>
    
    ...with this:

    Code:
    <xen:if hascontent="true">
    	<div class="section membersOnline userList">
    		<div class="secondaryContent">
    			<h3>{xen:phrase staff_online_now}</h3>
    			<ol class="listInline">
    				<xen:contentcheck>
    					<xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
    						<xen:if is="{$user.is_moderator} OR {$user.is_admin}">
    							<li>
    							<xen:if is="{$user.user_id}">
    								<a href="{xen:link members, $user}"
    									class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
    							</xen:if>
    							</li>
    						</xen:if>
    					</xen:foreach>
    				</xen:contentcheck>
    			</ol>
    		</div>
    	</div>
    </xen:if>
    
    Hopefully that helps. But like I said, it has the comma problem.
     
    Nasr likes this.
  5. Nasr

    Nasr Well-Known Member

    thank you very much jake. that did it. I tried to move <ol class="listInline"> as you did but couldnt find the right place.
     
  6. Forsaken

    Forsaken Well-Known Member

    How did the code output HTML?

    I just tried it on a new template, it its still working perfectly fine.
     
  7. Nasr

    Nasr Well-Known Member

    When I used that code It didnt align staff side by side, rather it just showed them on top of each other and some HTML code and when i hover over that HTML it would display the name in a tooltip. it could be something in my template though, i have a heavely modified style.

    What Jake did worked perfect for me though.
     

Share This Page