XF 2.2 Add prefix to thread title in post (on top of "post subject" addon)

voom

Member
I use https://xenforo.com/community/resources/eae-add-ons-post-subject.8335/ to show the thread title inside every post for orientation ("what was this thread about again?") Now because prefixes in some nodes have the role to focus the discussion on a certain context, I would like to add the prefix to the subject inside the posts.

The main question is: is there a variable for the thread-prefix that I can use to modify the post-subject template with the expected result? Or is there another way to get that value and inject it into the post?
 

voom

Member
Solved it: I get the prefix name and style with:

{{ prefix('thread', $thread, 'html', '') }}

So in eae_psj_post_subject_insert

I FIND
{$thread.title}

and REPLACE with:
<span class="prefix-in-post">{{ prefix('thread', $thread, 'html', '') }}</span> $0

in extra.less (styled for my needs) which is why I added the span.prefix-in-post class
CSS:
.prefix-in-post .label {
    padding: 1px 1px;
    font-size:95%;
    opacity:0.8;
    font-weight:bold;
    float:right;
}

This puts it to the right of the post, in the same line, takes the style back a little (to avoid too many attention stimuli in the post) and enhances the text inside...
 
Top