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

XF 1.5 What I'm doing wrong editing /recent-activity/ ?

Discussion in 'Styling and Customization Questions' started by rafass, Sep 4, 2015.

  1. rafass

    rafass Well-Known Member

    This is the page: Recent Activity | XenForo Community
    I need to put something here: (after the username)
    Screen shot 2015-09-04 at 7.41.29 PM.png
    I've already checked everything, and I'm 99% sure the only template I have to edit is
    news_feed_item [right?]
    Code:
    <li id="{xen:if $itemId, $itemId, 'item_{$item.news_feed_id}'}" class="event primaryContent NewsFeedItem" data-author="{$item.username}">
    
        <xen:avatar user="$item" size="s" class="icon" />
    
        <div class="content">  
            {xen:raw $itemTemplate}
      
            <xen:datetime time="{$itemDate}" />
        </div>
    </li>
    Has been impossible show my element there. I mean, it show but in other locations. like:
    Screen shot 2015-09-04 at 7.40.06 PM.png
    But there are not any way to put my element next to the username.

    I did the same in more than 20 templates already and everything has been perfect.
    What I'm doing wrong with that page? some help is really appreciated.
     
    Last edited: Sep 4, 2015
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Look at the individual news_feed_item_* templates to see how the content is constructed.

    In the case above, it would be news_feed_item_resource_update_like.
     
  3. rafass

    rafass Well-Known Member

    Hello Brogan.
    Before open this thread, A friend told me the same, and I've been checking the content of all my news_feed_item_*
    and the final conclusion is that the only template appropriated to to this is news_feed_item
    This my list of news_feed_item_* :
    Screen shot 2015-09-04 at 7.36.16 PM.png
    I've changed the screenshots to show my own case. (I have not installed the resource manager yet. so I have only 14 templates. (all of them checked carefully) nothing to do there. (apparently)
    The only template to have sense to edit is (according what I need) is news_feed_item
    The result is always the same:
    Screen shot 2015-09-04 at 7.54.13 PM.png Screen shot 2015-09-04 at 7.53.52 PM.png
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    It's not possible to add an icon after the user name by editing the news_feed_item template.

    The user name is added via one of the specific templates.
     
    rafass likes this.
  5. rafass

    rafass Well-Known Member

    Excellent! That worked! you're absolutely right. (y) I was very wrong, finally I found it: news_feed_item_post_insert
    Code:
    <h3 class="description">
    
        <xen:if is="{$content.attach_count}">
       
            <xen:comment><!-- $user attached a file to a post --></xen:comment>
            {xen:phrase news_feed_post_insert_attachment,
                'username={xen:helper username, $user, 'primaryText'}
               
                        <here>
               
                ',
                'threadTitle=<a href="{xen:link posts, $content}"{xen:if '{$content.hasPreview}', ' class="PreviewTooltip" data-previewUrl="{xen:link threads/preview, $content}"'}>{xen:helper threadPrefix, $content}{$content.title}</a>'}
       
        <xen:else />
       
            <xen:comment><!-- $user posted a post --></xen:comment>
            {xen:phrase news_feed_post_insert,
                'username={xen:helper username, $user, 'primaryText'}
               
                        <here>
               
                ',
                'threadTitle=<a href="{xen:link posts, $content}"{xen:if '{$content.hasPreview}', ' class="PreviewTooltip" data-previewUrl="{xen:link threads/preview, $content}"'}>{xen:helper threadPrefix, $content}{$content.title}</a>'}
    
        </xen:if>
       
    </h3>
    
    <p class="snippet post">{xen:helper snippet, $content.message, $xenOptions.newsFeedMessageSnippetLength, {xen:array 'stripQuote=1'}}</p>
    
    <xen:include template="news_feed_attached_images" />
    
    Thanks so much for the great support as always! ;)
     
  6. katsulynx

    katsulynx Well-Known Member

    The other news_feed_item templates include a username as well if you want to include your ribbon there.
     
    rafass likes this.
  7. rafass

    rafass Well-Known Member

    Got it (y) Thank you katsulynx!
    --
    Now I'm facing problems with my conditional in the code:
    Screen shot 2015-09-04 at 8.55.44 PM.png
    Is showing the badge in the wrong users. o_O
     
    Last edited: Sep 5, 2015
  8. katsulynx

    katsulynx Well-Known Member

    What conditional are you using?
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    I suspect that is applying to you rather than the associated member.
     
  10. Snog

    Snog Well-Known Member

    You'll never get a proper response in the alert or recent activity templates using the conditional you showed in another thread without some PHP coding.

    $user does not contain the user groups for the user in the alerts.

    Code:
    array(5) {
       ["user_id"] => int(11)
       ["username"] => string(5) "MTest"
       ["gender"] => string(4) "male"
       ["gravatar"] => string(0) ""
       ["avatar_date"] => int(1405082762)
    }
    
     
    Last edited: Sep 4, 2015
    rafass likes this.
  11. rafass

    rafass Well-Known Member

    Thank you Snog! that's true. (unfortunately)
    Is not possible make this the modification in certain templates in the normal way. (alerts & feed)(doesn't recognize my conditional)(on my particular case)
    That would require a custom development with PHP files.
    --
    Question:
    This is "As designed"? (all the info for a user isn't available to all templates)
    Or is something that could be improved in the future if is suggested?
     
    Last edited: Sep 5, 2015

Share This Page