XF 2.0 Sticky prefix?

By creating a prefix in the ACP?
Don't understand the question honestly.
You see the "please read:" part in the photo? On default a sticky is without such a prefix and just the title I want to know how I can set a pre-set text like that before the title of a sticky. Preferably with the pin :)
 
Again, please either read the XF2 manual or go through the ACP settings yourself or search the forums for "prefix".

https://xenforo.com/xf2-docs/manual/threads/#prefixes

Anyway, again, you just go to your ACP, create a prefix, make it available in a node you want to have it, and then you can assign a prefix to any threads (sticky or normal, doesnt matter).
You can even use FontAwesome Icons (like the pin) in your prefix, if you use custom css. So instead choosing a default XF style for the prefix, you choose a custom one while adding the style in your extra.less template.

Just search the forums if you dont know what I am talking about.
 
In thread_list_macros find
HTML:
                    <xf:if is="$thread.sticky">
                        <li>
                            <i class="structItem-status structItem-status--sticky" aria-hidden="true" title="{{ phrase('sticky')|for_attr }}"></i>
                            <span class="u-srOnly">{{ phrase('sticky') }}</span>
                        </li>
                    </xf:if>
and remove the "u-srOnly" class from the span tag. Move around the if block as you fit.
 
Last edited:
In thread_list_macros find
HTML:
                    <xf:if is="$thread.sticky">
                        <li>
                            <i class="structItem-status structItem-status--sticky" aria-hidden="true" title="{{ phrase('sticky')|for_attr }}"></i>
                            <span class="u-srOnly">{{ phrase('sticky') }}</span>
                        </li>
                    </xf:if>
and remove the "u-srOnly" class from the span tag. Move around the if block as you fit.
Aight, I will check what this results in, cheers.

Do you mean for the prefix to be automatically added when you make a sticky?
Yes.

Again, please either read the XF2 manual or go through the ACP settings yourself or search the forums for "prefix".

https://xenforo.com/xf2-docs/manual/threads/#prefixes

Anyway, again, you just go to your ACP, create a prefix, make it available in a node you want to have it, and then you can assign a prefix to any threads (sticky or normal, doesnt matter).
You can even use FontAwesome Icons (like the pin) in your prefix, if you use custom css. So instead choosing a default XF style for the prefix, you choose a custom one while adding the style in your extra.less template.

Just search the forums if you dont know what I am talking about.
I know what it says but if I knew how to do it I wouldn't ask and as the title of this section is "Styling and customization questions" I thought I would ask it ;)

So if you can tell me which code to change and how to add the pin also that would be great as I'm new to Xenforo.

Cheers.
 
Top Bottom