1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Show Number of Comments on Homepage

Discussion in 'Showcase Support' started by beanfan78, Nov 18, 2014.

  1. beanfan78

    beanfan78 Member AMS Premium SC Premium

    Bob, I have Showcase running in list mode. The list mode gives you everything from the stars, views, and even last updated. Is there a way to show how many comments an items has? I had a member request it and I guess I didn't notice that it wasn't part of the stats. Just curious if this is possible.

    Adam
     
  2. Bob

    Bob Developer Staff Member

    Its possible via a template edit as the data IS exposed. It DOES change the appearance of the list view as the height of each row will be increased. If you are fine with a template edit, let me know and I will show you how to do it.
     
  3. beanfan78

    beanfan78 Member AMS Premium SC Premium

    Thanks for the reply Bob. If you can show me the template edits I would greatly appreciate it. Also, is there a way to show new comments as well in notifications or show when someone replies to a comment I left?
     
  4. Bob

    Bob Developer Staff Member

    I'll post up the edit sometime today (when I get a free minute).

    As for the notices, when watching an item, you will get alerts when new comments are posted (this can be turned on and off per individual via alert options). There is also the most recent comments sidebar block.
     
  5. beanfan78

    beanfan78 Member AMS Premium SC Premium

    Thanks Bob, no rush at all. I completely forgot about the watching items. I guess I completely spaced on that one...
     
  6. Bob

    Bob Developer Staff Member

    sorry for the delay..... kinda a shit week for me with Funeral today and a lot of Family in and out of the house all week long.

    OK... This is what you need to do. First, you need to open(edit) the template: nflj_showcase_layout_list_view_item

    Below is a snippet(block of code) in that template deals with all the stats that are POTENTIALLY shown. I say potentially, as they display depending on the sort order type that is being viewed as well as other factors.... ie, if you look at the template code, you will see individual stats wrapped by IF statements which determines whether or not they will display or not. The first one is the RATING. This only displays IF the item is in a category that has the Rate Review System enabled. The 2nd one is REVIEW specific. It only displays when the SORT ORDER is "Top Rated" or "Most Reviewed" AND the Rate Review system is set to REVIEW. The 3rd block only displays when viewing the Most Liked Sort Order Tab. The 4th block (Views) displays only on the Most Recent, Most Popular, Updated and Alphabetical Sort Tabs. The last block (updated) only displays if the item has been updated.

    NOW, with that said.... you need to decide if you want the comments count to display on EVERY Sort Order Tab or just on specific ones. I also need to know the order (above or below a specific stat) that you want to display the comment count... This is important, because you'll need to use a specific CSS class depending on where the stat is going to be displayed within the block. Once you let me know the exact details, I'll be able to post the exact template syntax you need to add to the itemStats block.

    HTML:
        <div class="listBlock itemStats">
            <div class="listBlockInner">
                <xen:if is="{$item.rate_review_system} == 1 || {$item.rate_review_system} == 2">
                    <xen:include template="rating">
                        <xen:set var="$rating">{$item.rating}</xen:set>
                        <xen:set var="$hint">{xen:if '{$item.rating_count} == 1', {xen:phrase 1_vote}, {xen:phrase x_votes_plural, 'count={$item.rating_count}'}}</xen:set>
                    </xen:include>                           
                </xen:if>
    
                <div class="pairsJustified ">
                    <xen:if is="{$order} == 'rated' || {$order} == 'reviewed' && {$item.rate_review_system} == 2">
                        <dl class="reviewStats">
                            <dt>{xen:phrase nflj_showcase_reviews}:</dt>
                            <dd>{$item.review_count}</dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="{$order} == 'liked'">
                        <dl class="reviewStats">
                            <dt>{xen:phrase nflj_showcase_likes}:</dt>
                            <dd>{$item.likes}</dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="{$order} == 'recent' || {$order} == 'popular' || {$order} == 'updated' || {$order} == 'atoz'">
                        <dl class="viewStats">
                            <dt>{xen:phrase nflj_showcase_views}:</dt>
                            <dd>{$item.view_count}</dd>
                        </dl>
                    </xen:if>
    
                    <xen:if is="{$item.last_update}">
                        <dl class="updatedStats">
                            <dt>{xen:phrase nflj_showcase_updated}:</dt>
                            <dd><xen:datetime time="$item.last_update" /></dd>
                        </dl>
                    </xen:if>       
                </div>   
            </div>                       
        </div>    
     
  7. beanfan78

    beanfan78 Member AMS Premium SC Premium

    Bob, a sincere thank you for taking the time. I hate to hear it's that kind of week for you. I am at work right now, but I am going to play with this this weekend (which starts tonight for me). I am really excited about putting the finishing touches on this add-on. I liked Showcase before, but now I am loving it! I will follow up shortly.
     
  8. Bob

    Bob Developer Staff Member

    btw, the variable for comment count = $item.comment_count

    so at the minimum, you'd be inserting something like this (this will insert the comments count IF there are any comments)
    HTML:
    <xen:if is="{$item.comment_count}">
         <dl class="reviewStats">
              <dt>{xen:phrase nflj_showcase_comments}:</dt>
              <dd>{$item.comment_count}</dd>
         </dl>
    </xen:if>
     
  9. beanfan78

    beanfan78 Member AMS Premium SC Premium

    Bob, ultimately I would like the comment count to display on all the tabs. I would like it to be basically a standard so people can be encouraged to read. You can see what I am cooking up with your plugin here www.epicallytech.com to give you a better idea. Does that answer the intent a bit better? I am going to play with the snippet you posted above this for a bit.
     
  10. beanfan78

    beanfan78 Member AMS Premium SC Premium

    Actually from what I see, it looks perfect. It shows on all tabs and that's what I wanted.
     
  11. Bob

    Bob Developer Staff Member

    Ya, tabs has nothing to do with it. What you are doing is editing the template for the list item, so everywhere that you use the List View layout, it will be displayed. Make sure its displaying correctly on all responsive modes (wide, medium and narrow).
     
  12. beanfan78

    beanfan78 Member AMS Premium SC Premium

    It looks good on mobile as well. I might have to try to color code the text a bit to break it up but otherwise I think this is a valuable data point to show and I think the readers will enjoy!
     
    BT012SS and Bob like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.