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

Template question

Discussion in 'XenForo Questions and Support' started by Laric, Mar 19, 2011.

  1. Laric

    Laric Active Member

    As I am even worse with templates than I am with code I need some help if some kinda soul could give it to me.

    Below you will see my code for my ventrilo status. It is meant to go into the sidebar.
    Code:
    <xen:if is="{$laric_ventrilo.canView}">
    <div class="section">
        <div class="secondaryContent" id="ventrilo" style="padding-bottom: 10px;">
            <h3>{xen:raw $laric_ventrilo.servername}</h3>
    <xen:foreach loop="$laric_ventrilo.chanclient" value="$channel">
    {xen:raw $channel.name}
        <xen:foreach loop="$channel.clients" value="$client">
              {xen:raw $client}
          </xen:foreach>
    </xen:foreach>
    </div></div>
    </xen:if>
    Above is my current template.
    The first part is ok (the servername part)
    Then there is the list of channels. Within each channel there might be clients.
    I just cant get it to be 'pretty'.

    I sort of want it to look like this

    Servername
    channelname1
    <indentation>client1
    <indentation>client2
    channelname2
    channelname3
    <indentation>client3
    channelname4
    <indentation>client5

    Anybody who can help me?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Try this:

    Code:
    <xen:if is="{$laric_ventrilo.canView}">
    <div class="section">
    	<div class="secondaryContent" id="ventrilo" style="padding-bottom: 10px;">
    		<h3>{xen:raw $laric_ventrilo.servername}</h3>
    		<xen:foreach loop="$laric_ventrilo.chanclient" value="$channel">
    
    			{xen:raw $channel.name}
    
    			<div style="margin-left: 10px;">
    				<xen:foreach loop="$channel.clients" value="$client">
    					{xen:raw $client}<br />
    				</xen:foreach>
    			</div>
    
    		</xen:foreach>
    	</div>
    </div>
    </xen:if>
    
     
    Laric and Nasr like this.
  3. Laric

    Laric Active Member

    Thanks
     

Share This Page