XF 2.1 How to target forum and prefix ID in HTML?

Alternadiv

Well-known member
I'm trying to use HTML to put some clickable prefixes in some node descriptions. What would be the proper HTML for that? I tried a few things that wouldn't fully work.
 
I think I found it:

HTML:
<a class="labelLink" href="?prefix_id=1">
<span class="label label--red">Name of Prefix 1</span></a>

Edit: This shows the prefix, but clicking it isn't a working link. I think it somehow needs to forum ID added to it.

Edit 2: Got it.

HTML:
https://tacoma3g.com/forums/armor-wheels-tires-suspension-gearing.8/?prefix_id[0]=3
 
Last edited:
I have it running and it looks nice. This is the forum description:
HTML:
Biggest tire on stock suspension? Want to run 35s? How much lift? Do you need to re-gear? Can't decide on bumpers or armor? Answers and related discussions can be found here.<br />
<small><b>FILTER BY:</b></small>
<a class="labelLink" href="/forums/armor-wheels-tires-suspension-gearing.8/?prefix_id[0]=3">
<span class="label label--silver"><small>ARMOR</small></span></a>
<a class="labelLink" href="/forums/armor-wheels-tires-suspension-gearing.8/?prefix_id[0]=1">
<span class="label label--royalBlue"><small>WHEELS/TIRES</small></span></a>
<a class="labelLink" href="/forums/armor-wheels-tires-suspension-gearing.8/?prefix_id[0]=2">
<span class="label label--red"><small>SUSPENSION</small></span></a>
<a class="labelLink" href="/forums/armor-wheels-tires-suspension-gearing.8/?prefix_id[0]=31">
<span class="label label--green"><small>GEARING</small></span></a>

This is what it looks like:
1587415567597.webp
1587415582350.webp

The only issue I see with this is, if you ever change the color or wording of your prefix, you need to manually change it here as well.

@Russ @ozzy47, do you know if there is a way to have it automatically done.
 
I have it running and it looks nice. This is the forum description:
HTML:
Biggest tire on stock suspension? Want to run 35s? How much lift? Do you need to re-gear? Can't decide on bumpers or armor? Answers and related discussions can be found here.<br />
<small><b>FILTER BY:</b></small>
<a class="labelLink" href="/forums/armor-wheels-tires-suspension-gearing.8/?prefix_id[0]=3">
<span class="label label--silver"><small>ARMOR</small></span></a>
<a class="labelLink" href="/forums/armor-wheels-tires-suspension-gearing.8/?prefix_id[0]=1">
<span class="label label--royalBlue"><small>WHEELS/TIRES</small></span></a>
<a class="labelLink" href="/forums/armor-wheels-tires-suspension-gearing.8/?prefix_id[0]=2">
<span class="label label--red"><small>SUSPENSION</small></span></a>
<a class="labelLink" href="/forums/armor-wheels-tires-suspension-gearing.8/?prefix_id[0]=31">
<span class="label label--green"><small>GEARING</small></span></a>

This is what it looks like:
View attachment 223013
View attachment 223014

The only issue I see with this is, if you ever change the color or wording of your prefix, you need to manually change it here as well.

@Russ @ozzy47, do you know if there is a way to have it automatically done.
This might work:
 
Top Bottom