XF 2.0 New posts widget

JoyFreak

Well-known member
Does anyone know where to look for the editing of the new posts widget?
I wanted to change the ordering of the post and date etc.

Screenshot attached.
Thanks.

new posts.webp
 
Thats only settings for the widget and not the template, I did look under the new_posts widget template but can't seem to find the necessary parts so i don't think its in there.
 
How would I do that then? I wanted to remove the category link and wanted the username clickable and under the thread title, with the date next to it.
You can remove the category link and make the user name clickable in the template. Sorry, I misunderstood you. I thought you meant you wanted to change the order the posts are displayed in the list (which is not possible with just a template change), not the order of the post title and post date within in each line - which is possible.
 
Last edited:
No worries :). I am looking at it, been playing around with it but no luck. Where is the category bit? Can't find it. Also the username, can't find the code in there.
 
So I found the username bit in the thread_macros_list and the code but I can't seem to make the username linkable? Any ideas?

"<li>{{ phrase('latest_x', {'name': $thread.last_post_cache.username}) }}</li>"
 
I believe the way to do it is to replace this:

Code:
            <div class="contentRow-minor contentRow-minor--hideLinks">
                <ul class="listInline listInline--bullet">
                    <li>{{ phrase('latest_x', {'name': $thread.last_post_cache.username}) }}</li>
                    <li><xf:date time="{$thread.last_post_date}" /></li>
                </ul>
            </div>

With this:

Code:
            <div class="contentRow-minor contentRow-minor--hideLinks">
                <ul class="listInline listInline--bullet">
                    <li><xf:username user="{$thread.LastPoster}" defaultname="{$thread.last_post_cache.username}" /></li>
                    <li><xf:date time="{$thread.last_post_date}" /></li>
                </ul>
            </div>

Someone let me know if I'm wrong :)
 
I believe the way to do it is to replace this:

Code:
            <div class="contentRow-minor contentRow-minor--hideLinks">
                <ul class="listInline listInline--bullet">
                    <li>{{ phrase('latest_x', {'name': $thread.last_post_cache.username}) }}</li>
                    <li><xf:date time="{$thread.last_post_date}" /></li>
                </ul>
            </div>

With this:

Code:
            <div class="contentRow-minor contentRow-minor--hideLinks">
                <ul class="listInline listInline--bullet">
                    <li><xf:username user="{$thread.LastPoster}" defaultname="{$thread.last_post_cache.username}" /></li>
                    <li><xf:date time="{$thread.last_post_date}" /></li>
                </ul>
            </div>

Someone let me know if I'm wrong :)


hello...close to what im after here....i wonder can anyone help me complete the challenge?

we want to change the avatar displayed in the widget to the topic AUTHOR....rather than listing the latest poster 2 times....

something around this sort of {$thread.LastPoster}.......

what is the proper syntax for {$thread.StarterName} or whatever it is?

please and thank you
 
I want to make similar modifications to the New threads widget. This is the original code.
HTML:
<div class="contentRow-minor contentRow-minor--hideLinks">
    <ul class="listInline listInline--bullet">
        <li>{{ phrase('started_by_x', {'name': $thread.username}) }}</li>
        <li><xf:date time="{$thread.post_date}" /></li>
        <li>{{ phrase('replies:') }} {$thread.reply_count|number_short}</li>
    </ul>
</div>


I want to:
1) Get rid of the phrase "Started by"
2) Make the username linkable
3) If the number of replies is zero, then hide the phrase "Replies: 0"
4) If the number of replies is 1 or more, change the phrase to "X replies" instead of "Replies: X"

This is what I have so far:
HTML:
<div class="contentRow-minor contentRow-minor--hideLinks">
    <ul class="listInline listInline--bullet">
        <li><xf:username user="{$thread.username}" defaultname="{$thread.username}" /></li>
        <li><xf:date time="{$thread.post_date}" /></li>
        <li>{$thread.reply_count|number_short} replies</li>
    </ul>
</div>

Still need to hide the number of replies when replies = 0 and hot-link the username. Can anyone suggest corrections to the code above? @JoyFreak @Joe Link? Thanks!
 
Top Bottom