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

Reorder Sidebar

Discussion in 'XenForo Questions and Support' started by ashkir, Jul 10, 2012.

  1. ashkir

    ashkir Active Member

    Is there a way we can reorder our sidebar? We have RecentStatus in it as well. We'd like to move it higher.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That must be from the widget addon? I actually haven't used that addon. I assume it has an option to change the display order of widgets.

    For the default sidebar on the index page you can reposition the blocks by editing this template:

    Admin CP -> Appearance -> Templates -> forum_list
     
  3. -Ice-

    -Ice- Active Member

    In the forum_list template:
    HTML:
    <xen:sidebar>
        <xen:edithint template="sidebar.css" />
     
        <xen:hook name="forum_list_sidebar">
            <xen:include template="sidebar_online_users" />
     
            <!-- block: forum_stats -->
            <div class="section">
                <div class="secondaryContent statsList" id="boardStats">
                    <h3>{xen:phrase forum_statistics}</h3>
                    <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>
            </div>
            <!-- end block: forum_stats -->
     
            <xen:include template="sidebar_share_page">
                <xen:set var="$url">{xen:link canonical:index}</xen:set>
            </xen:include>
     
        </xen:hook>
    </xen:sidebar>
    We use the RCBD Recent Status add-on in my forums, so if you're using that here's how you do it (if not, its probably very similar). The way it works is it listens for that <xen:hook name="forum_list_sidebar">, and adds in the content before the end of the last </xen:hook>. Here's how I would do it:

    Add <xen:hook name="recentStatus" /> wherever in this sidebar code you want. You also need to modify this file: "library/RCBD/RecentStatus/Listener/TemplateHook.php".

    Find this:
    PHP:
     if ($name === 'forum_list_sidebar') {
    Change to this:
    PHP:
     if ($name === 'recentStatus') {
    For example, if you wanted it below the online users and above the forum stats, do this:
    HTML:
    <xen:sidebar>
        <xen:edithint template="sidebar.css" />
     
        <xen:hook name="forum_list_sidebar">
            <xen:include template="sidebar_online_users" />
     
            <xen:hook name="recentStatus" />
     
            <!-- block: forum_stats -->
            <div class="section">
                <div class="secondaryContent statsList" id="boardStats">
                    <h3>{xen:phrase forum_statistics}</h3>
                    <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>
            </div>
            <!-- end block: forum_stats -->
     
     
            <xen:include template="sidebar_share_page">
                <xen:set var="$url">{xen:link canonical:index}</xen:set>
            </xen:include>
     
        </xen:hook>
    </xen:sidebar>
    I highly recommend using the Template Modification System if you have it installed to do this :D
     
  4. ashkir

    ashkir Active Member

    It has no option sadly. :(.

    Edit: SOmeone posted! Hi there! I'll try this after I reread it a few more times.
     

Share This Page