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

Forum Statistics block underneath portals & forums index

Discussion in 'Styling and Customization Questions' started by bogus, Apr 22, 2011.

  1. bogus

    bogus Guest

    Hello. How can i get the Forum Statistics Block underneath the portals & forums index instead of displayed in the Sidebar? Thanks
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You will just need to edit the templates to achieve the look you want.

    The forum_list template is the one you need to work with.
     
  3. bogus

    bogus Guest

    Ok, thanks for the help Brogan
     
  4. bogus

    bogus Guest

    Edit: I cant get it working....
    This is the Code i added to node_list Template
    Code:
    <!-- block: forum_stats -->
        <ol class="nodeList sectionMain" id="boardStats">
            <div class="nodeInfo categoryNodeInfo categoryStrip">
    
                <h3 class="nodeTitle">{xen:phrase forum_statistics}</h3>
            </div>
                <div class="pairsJustified">
                        <dl class="discussionCount"><dt>{xen:phrase discussions}:</dt>
                            <dd>{xen:number $boardTotals.discussions}</dd></dl>
                        <dl class="messageCount"><dt>{xen:phrase messages}:</dt>
                            <dd>{xen:number $boardTotals.messages}</dd></dl>
                        <dl class="memberCount"><dt>{xen:phrase members_count}:</dt>
                            <dd>{xen:number $boardTotals.users}</dd></dl>
                        <dl><dt>{xen:phrase latest_member}:</dt>
                            <dd><xen:username user="$boardTotals.latestUser" /></dd></dl>
                        <!-- slot: forum_stats_extra -->
                </div>
        </ol>
    <!-- end block: forum_stats -->
    You can see it here what it looks like. Pls scroll to the end
    I would like to make 3 Row part. Why? Because i want to add other things to the Sidebar, at the end i would be to much for the Sidebar. Thats why i want to try adding some Stats to different locations
    1. Forum Statistics
    2. Staff Online Now
    3. Members Online Now
    Unbenannt.jpg

    but i have no idea how the css part has to look like
    Every try ends up in a disaster. Thanks a lot for every help
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    I just added a new div to your css and used some inline styling.
    If you create a new class and add it to EXTRA.css, it should give you the effect you're after.

    Code:
    <!-- block: forum_stats -->
        <ol class="nodeList sectionMain" id="boardStats">
            <div class="nodeInfo categoryNodeInfo categoryStrip">
                <h3 class="nodeTitle">{xen:phrase forum_statistics}</h3>
            </div>
            <div style="width: 33%; padding: 0 10px; border-right: 1px solid @primaryLight">
                <div class="pairsJustified">
                        <dl class="discussionCount"><dt>{xen:phrase discussions}:</dt>
                            <dd>{xen:number $boardTotals.discussions}</dd></dl>
                        <dl class="messageCount"><dt>{xen:phrase messages}:</dt>
                            <dd>{xen:number $boardTotals.messages}</dd></dl>
                        <dl class="memberCount"><dt>{xen:phrase members_count}:</dt>
                            <dd>{xen:number $boardTotals.users}</dd></dl>
                        <dl><dt>{xen:phrase latest_member}:</dt>
                            <dd><xen:username user="$boardTotals.latestUser" /></dd></dl>
                        <!-- slot: forum_stats_extra -->
                </div>
            </div>
        </ol>
    <!-- end block: forum_stats -->
    You may need to play with the css a bit to get it looking exactly how you want.
     
    SportainmentMG and Tilki├čey like this.
  6. bogus

    bogus Guest

    Thanks Brogan, just done it now ;)
     
  7. Alfa1

    Alfa1 Well-Known Member

    This will be my first edit of XF templates and I need to get accustomed to it. I want to remove the whole sidebar and to place all statistics to below the forum index. The 3 row approach that Bogus wants seems good. I have replace the original forum_stats block with Brogans code, but that does not work for me. I assume that I need to move that code to another template?

    I also want to move the 'share this page' block to above the forum index.

    Can anyone please advise?
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    The node_list template, right at the bottom.

    That is this section of code in the forum_list template:
    Code:
    <xen:include template="sidebar_share_page">
    <xen:set var="$url">{xen:link canonical:index}</xen:set>
    </xen:include>
    However, as you presumably want it in a horizontal format, you would be better off using the code from the thread_view template:
    Code:
    <xen:include template="share_page">
    <xen:set var="$url">{xen:link 'canonical:threads', $thread}</xen:set>
    </xen:include>
    Try adding that to the top of the node_list template.
     
    SportainmentMG likes this.
  9. Alfa1

    Alfa1 Well-Known Member

    The sidebar is gone now :)
    How do I get the stats and online users to display nicely?
    Above you mention adding a class. I have not done that yet. How do I add a class and where?

    My forum_list template:
    Code:
    <xen:h1>{$xenOptions.boardTitle}</xen:h1>
    
    <xen:container var="$head.canonical"><link rel="canonical" href="{xen:link 'canonical:index'}" /></xen:container>
    <xen:if is="{$xenOptions.boardDescription}"><xen:container var="$head.description">
        <meta name="description" content="{$xenOptions.boardDescription}" /></xen:container></xen:if>
    <xen:container var="$head.openGraph">
        <xen:include template="open_graph_meta">
            <xen:set var="$url">{xen:link 'canonical:index'}</xen:set>
            <xen:set var="$title">{$xenOptions.boardTitle}</xen:set>
        </xen:include></xen:container>
    
    <xen:hook name="forum_list_nodes">
        <xen:if is="{$renderedNodes}"><xen:include template="node_list" /></xen:if>
    </xen:hook>
    My node_list template:
    Code:
    <xen:require css="node_list.css" />
    <xen:include template="share_page">
    <xen:set var="$url">{xen:link 'canonical:threads', $thread}</xen:set>
    </xen:include>
    
    <xen:if hascontent="true">
    <fieldset>
        <ol class="nodeList sectionMain" id="forums">
        <xen:contentcheck>
            <xen:foreach loop="$renderedNodes" value="$node">{xen:raw $node}</xen:foreach>
        </xen:contentcheck>
        </ol>
    
        <xen:if is="{$newDiscussionButton}"><div class="nodeListNewDiscussionButton">{xen:raw $newDiscussionButton}</div></xen:if>
    </fieldset>
    </xen:if>
    
    <xen:edithint template="node_category.css" />
    <xen:edithint template="node_category_level_1" />
    <xen:edithint template="node_category_level_2" />
    <xen:edithint template="node_category_level_n" />
    
    <xen:edithint template="node_forum.css" />
    <xen:edithint template="node_forum_level_1" />
    <xen:edithint template="node_forum_level_2" />
    <xen:edithint template="node_forum_level_n" />
    
    <xen:edithint template="node_page.css" />
    <xen:edithint template="node_page_level_1" />
    <xen:edithint template="node_page_level_2" />
    <xen:edithint template="node_page_level_n" />
    
    <xen:edithint template="node_link.css" />
    <xen:edithint template="node_link_level_1" />
    <xen:edithint template="node_link_level_2" />
    <xen:edithint template="node_link_level_n" />
    <!-- block: forum_stats -->
        <ol class="nodeList sectionMain" id="boardStats">
            <div class="nodeInfo categoryNodeInfo categoryStrip">
                <h3 class="nodeTitle">{xen:phrase forum_statistics}</h3>
            </div>
            <div style="width: 33%; padding: 0 10px; border-right: 1px solid @primaryLight">
                <div class="pairsJustified">
                        <dl class="discussionCount"><dt>{xen:phrase discussions}:</dt>
                            <dd>{xen:number $boardTotals.discussions}</dd></dl>
                        <dl class="messageCount"><dt>{xen:phrase messages}:</dt>
                            <dd>{xen:number $boardTotals.messages}</dd></dl>
                        <dl class="memberCount"><dt>{xen:phrase members_count}:</dt>
                            <dd>{xen:number $boardTotals.users}</dd></dl>
                        <dl><dt>{xen:phrase latest_member}:</dt>
                            <dd><xen:username user="$boardTotals.latestUser" /></dd></dl>
                        <!-- slot: forum_stats_extra -->
                </div></div>
    <xen:include template="sidebar_online_users" />
    
        </ol>
    <!-- end block: forum_stats -->
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    You will need to create some custom CSS and classes and add them to EXTRA.css

    Then use those classes to create the look and style you want, replacing the inline styling in the above code.
     
  11. Alfa1

    Alfa1 Well-Known Member

    ai. CSS is not my best side. How would I create the same as Bogus posted?
     

Share This Page