New [anchor=name]...[/anchor] BBCode

Post Reply
User avatar
Dave Keenan
Site Admin
Posts: 2180
Joined: Tue Sep 01, 2015 2:59 pm
Location: Brisbane, Queensland, Australia
Contact:

New [anchor=name]...[/anchor] BBCode

Post by Dave Keenan »

You'll notice a new ANCHOR button in the post editor.

Instead of having to tell someone to skip to the 5th paragraph of a linked post of yours, to read about say estimated popularity rank (of ratios), you can simply edit that post to add an anchor named say "rank" before the start of the 5th paragraph, then you can link directly to it by adding #rank to the end of the URL for that topic (replacing the #p263 anchor for the start of that post).

I could have made the anchor invisible by adding only
[anchor=rank][/anchor]
but I chose to make it visible and self-explanatory, but small, by adding
[size=50][anchor=rank]#rank (anchor)[/anchor][/size]

Then I obtained the URL for the edited post in the usual manner, as
viewtopic.php?f=4&t=99&p=263#p263
and replaced the #p263 with #rank and so the link above was created as
[url=viewtopic.php?f=4&t=99&p=263#rank]estimated popularity rank[/url]
User avatar
cmloegcmluin
Site Admin
Posts: 1700
Joined: Tue Feb 11, 2020 3:10 pm
Location: San Francisco, California, USA
Real Name: Douglas Blumeyer (he/him/his)
Contact:

Re: New [anchor=name]...[/anchor] BBCode

Post by cmloegcmluin »

Dave Keenan wrote: Thu May 14, 2020 11:53 am Then I obtained the URL for the edited post in the usual manner, as
viewtopic.php?f=4&t=99&p=263#p263
and replaced the #p263 with #rank and so the link above was created as
[url=viewtopic.php?f=4&t=99&p=263#rank]estimated popularity rank[/url]
I tweaked the BBCode for anchor so that you can now obtain the link you need by simply clicking on your anchor and copy-pasting it out of your URL bar.
User avatar
Dave Keenan
Site Admin
Posts: 2180
Joined: Tue Sep 01, 2015 2:59 pm
Location: Brisbane, Queensland, Australia
Contact:

Re: New [anchor=name]...[/anchor] BBCode

Post by Dave Keenan »

Brilliant! Thanks! And thanks for making them look like links too.

You can also obtain the URL by right-clicking on the anchor and choosing "Copy link location" or equivalent.

Neither of these methods work if you choose to make your anchor invisible, in which case you'll have to fall back to the earlier method.
Post Reply