XF 2.3 How to make internal links in a post

Abraham54

Well-known member
How to make internal links in a post

Today I posted a thread with 10 sections:

Now a like to make in this message a content with 10 links to the different parts in this message.

But I do not know how to do that.
 
elevenforum is probably using a third party addon for how it is linking internally. i do not think xenforo allows for manually creating anchor links. there are workarounds like this: https://xenforo.com/community/threads/anchor-links-within-posts.177274/post-1445829

xenforo's native feature would not work like you are trying to make it work. you do not create manual links. you just use headers and use the links generated by xenforo.
 
elevenforum is probably using a third party addon for how it is linking internally.
I don't think it needs an addon, normal html anchor links can be made with an id (can be a div, span, heading etc) and then linking to the id with a hash.

But you are correct it isn't how the xenForo bbcode heading links work so maybe that is a red herrings as we cannot just use raw html in posts.

So if I make this a heading​


it's link anchor link is the [post link followed by # and the text, ie: https://xenforo.com/community/threa...st.228121/page-2#-so-if-i-make-this-a-heading
 
he is talking about code mentioned in my post above. he is making things unnecessarily complicated to replicate the behavior on how elevenforum is doing it. i have no idea how 11forum is doing it. and i have no idea how that bbcode operates. i mentioned it just as an example of doing it a different manner. it's not needed on xf 2.3. that post is from 2020 when 2.3 didn't exist and people had to use workarounds to get anchor links on posts.
 
I have now this:

Code:
[URL='https://www.piepcomp.nl/threads/10-dingen-die-ik-nooit-zal-doen-als-it-professional.15572/#1.-Verschuiven_in_plaats_van_ kopiëren'] [B]1.[/B][/URL] Verschuiven in plaats van kopiëren

There is some result, see picture:

View attachment 316827
 
It is still not working.

 
It is still not working.

No because your headings are still not xenForo bbcode headings. The html looks like:

<span style="font-size: 22px">Optie 1 Verschuiven in plaats van kopiëren</span>

Instead of

[HEADING=1]Optie 1 Verschuiven in plaats van kopiëren[/HEADING]

Which would then render as an html URL that you can link to in the index.

And in the html

<h2 class="bbHeading"><a class="u-anchorTarget" name="-optie-1-verschuiven-in-plaats-van-kopieren"></a>Optie 1 Verschuiven in plaats van kopiëren<a class="hoverLink" href="#-optie-1-verschuiven-in-plaats-van-kopieren" title="Permanent link"></a></h2>
<a class="u-anchorTarget" name="-optie-1-verschuiven-in-plaats-van-kopieren"></a>
Optie 1 Verschuiven in plaats van kopiëren
<a class="hoverLink" href="#-optie-1-verschuiven-in-plaats-van-kopieren" title="Permanent link"></a>
<<pseudo>></<pseudo>>
<a class="hoverLink" href="#-optie-1-verschuiven-in-plaats-van-kopieren" title="Permanent link"></a>
<h2 class="bbHeading"><a class="u-anchorTarget" name="-optie-1-verschuiven-in-plaats-van-kopieren"></a>Optie 1 Verschuiven in plaats van kopiëren<a class="hoverLink" href="#-optie-1-verschuiven-in-plaats-van-kopieren" title="Permanent link"></a></h2>

And would look like this in the post:

Optie 1 Verschuiven in plaats van kopiëren​


And you can see this in action, no addons, no extra bbcode, just stock xenForo as it works on here

Just click on the last bit of text in the following post and it links to the the above heading title.
 
Last edited:
Back
Top Bottom