XF 2.3 How to add text by the date in posts?

avalanch

Active member
Update: Line 118 of the template
post_macros
So I would like to modify this a bit to add text before the timestamp in posts, what would need to be done?

Untitled.webp
 
Last edited:
It's not on line 118 of 2.3.3, but, simply inserting the text you want before or within the link:
HTML:
            <li class="u-concealed">
                Test 
                <a href="{{ link('threads/post', $thread, {'post_id': $post.post_id}) }}" rel="nofollow">
                    <xf:date time="{$post.post_date}" itemprop="datePublished" />
                </a>
            </li>

1729570781494.webp

You can also use $post or even $xf variables to achieve other things such as this example in replacement of "Test" above.

HTML:
                <xf:if is="$post.attach_count > 0">
                    Attachments: {{ $post.attach_count }} - 
                </xf:if>

And get this:

1729570878837.webp
 
It's not on line 118 of 2.3.3, but, simply inserting the text you want before or within the link:
HTML:
            <li class="u-concealed">
                Test
                <a href="{{ link('threads/post', $thread, {'post_id': $post.post_id}) }}" rel="nofollow">
                    <xf:date time="{$post.post_date}" itemprop="datePublished" />
                </a>
            </li>
Ah well for me that template was unedited and line 118 was right at the anchor opening. So that's where I applied something that vb4 did to help boost keyword density.

But yes there are a few good options you can throw in there as well 😀
 
You could create custom thread fields for keywords and put that there too. But I think it'd only be good for the 1st post (thread).
Something like that is probably above my skill level. I know just enough to play around and guess and get by usually. That does sound interesting though.
 
Something like that is probably above my skill level. I know just enough to play around and guess and get by usually. That does sound interesting though.
I'm mobile right now, but I wouldn't mind showing you a custom thread field put there that would allow the first post to have a keyword or two when I get back in about 2 hours if you'd really like to modify it to have keywords there that can be set by editing the thread (or putting them there to begin with).
 
I'm mobile right now, but I wouldn't mind showing you a custom thread field put there that would allow the first post to have a keyword or two when I get back in about 2 hours if you'd really like to modify it to have keywords there that can be set by editing the thread (or putting them there to begin with).
Tomorrow maybe it's just past midnight here lol
 
Tomorrow maybe it's just past midnight here lol
On second thought, it'd require a lot more editing (to not show that custom thread field before the message, after the message, or in the thread status block) because my suggestion hasn't been implemented yet.

Suggestions: Custom placement (y)

Without editing the placement of one of the three available positions, it'd show twice.
 
Back
Top Bottom