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

XF 1.4 Aligning replies and views

Discussion in 'Styling and Customization Questions' started by reddy ink, Jan 25, 2015.

  1. reddy ink

    reddy ink Active Member

    I am trying to reconfigure replies and views in Forum_View so that number of replies appear under Replies and number from views appear under Views.

    Thank you,
    upload_2015-1-25_18-51-40.png
     
  2. mike406

    mike406 Member

    One possibility:

    In the 'thread_list_item' template find:
    Code:
        <div class="listBlock stats pairsJustified" title="{xen:phrase members_who_liked_first_message}: {xen:if $thread.isRedirect, '&ndash;', {xen:number $thread.first_post_likes}}">
            <dl class="major"><dt>{xen:phrase replies}:</dt> <dd>{xen:if $thread.isRedirect, '&ndash;', {xen:number $thread.reply_count}}</dd></dl>
            <dl class="minor"><dt>{xen:phrase views}:</dt> <dd>{xen:if $thread.isRedirect, '&ndash;', {xen:number $thread.view_count}}</dd></dl>
        </div>
    
    Replace with:
    Code:
        <div class="listBlock stats pairsJustified" title="{xen:phrase members_who_liked_first_message}: {xen:if $thread.isRedirect, '&ndash;', {xen:number $thread.first_post_likes}}">
            <dl class="major">
                <span>{xen:if $thread.isRedirect, '&ndash;', {xen:number $thread.reply_count}}</span>
                <span>{xen:if $thread.isRedirect, '&ndash;', {xen:number $thread.view_count}}</span>
            </dl>
        </div>
    
    Then add to your EXTRA.css template:
    Code:
    .pairsJustified span:nth-of-type(2) {
        float: right;
    }
    
     
    viper357 and reddy ink like this.
  3. reddy ink

    reddy ink Active Member

    Thank a lot! @mike406

    Also curious, How you were able to add start date on you site! (You have a clean and intuitive forum btw)

    upload_2015-1-25_20-34-8.png
     
    Last edited: Jan 26, 2015
  4. mike406

    mike406 Member

    Happy to help. :)

    Okay, first in 'thread_list' find this block and remove the 2nd <a> element from it (the Start Date link on the top bar). We're going to move it into its own block in a sec.
    Code:
            <dd class="main">
                <a href="{xen:link forums, $forum, '_params={$orderParams.title}'}" class="title"><span>{xen:phrase title}{xen:helper sortArrow, $order, $orderDirection, title}</span></a>
                <a href="{xen:link forums, $forum, '_params={$orderParams.post_date}'}" class="postDate"><span>{xen:phrase start_date}{xen:helper sortArrow, $order, $orderDirection, post_date}</span></a>
            </dd>
    
    Under the block that we just edited, add this after it.
    Code:
            <dd class="discStartDateHead">
                <a href="{xen:link forums, $forum, '_params={$orderParams.post_date}'}" class="postDate"><span>{xen:phrase start_date}{xen:helper sortArrow, $order, $orderDirection, post_date}</span></a>
            </dd>
    
    Now that we have the Start Date link separated into its own "column" we need to mirror that and add the dates themselves into 'thread_list_item'...
    In thread_list_item find this line here:
    Code:
    <div class="listBlock stats pairsJustified" title="{xen:phrase members_who_liked_first_message}: {xen:if $thread.isRedirect, '&ndash;', {xen:number $thread.first_post_likes}}">
    
    Right above it, add this:
    Code:
        <div class="listBlock stats discStartDate">
            <dl class="major">{xen:date $thread.post_date, 'absolute'}</dl>
        </div>
    
    For EXTRA.css:
    Code:
    .discussionList .discStartDateHead {
        width: 100px;
    }
    
    .discussionList div.discStartDate {
        width: 100px;
        background: transparent;
    }
    
     
    Bram, adaaamb and reddy ink like this.

Share This Page