XF 2.1 Anchor links within posts?

cdub

Well-known member
I have a VERY long post and I'd like to have anchor links to places within the long post.

Is there a way to do this?
 
Sure. Sometimes people use this in a brief table of contents at the top of the article.
  1. Insert an anchor id of your choice where you want the link to jump to. This can be anything but use underscore instead of spaces. Example: <a id="your_first_anchor_id">some text</a>
  2. Then earlier in the page create a link to that anchor id. Example: <a href="#your_first_anchor_id">Click here to jump to the first anchor id</a>
 
Hi, I have read the BB code tutorial mentioned above but could not figure out how to create a BB code anchor and link to that anchor (in the same post)

Could someone please post an example here of the BB code equivalent to the html mentioned in dbaxter's post above:
  1. Insert an anchor id of your choice where you want the link to jump to. This can be anything but use underscore instead of spaces. Example: <a id="your_first_anchor_id">some text</a>
  2. Then earlier in the page create a link to that anchor id. Example: <a href="#your_first_anchor_id">Click here to jump to the first anchor id</a>

Many thanks,
Mike
 
Crikey Guys, this really should not be rocket science. I'm looking through the Tutorial and I still can't figure out how to get this to work.
I keep getting this message
"Oops! We ran into some problems.
Please enter a value using only a-z, A-Z, 0-9, and _ characters."


However it doesn't show me which field or entry has the error.

Please can someone show what needs to go into which fields in the BBCode editor. I'm sorry, I'm not a professional coder, just a normally IT literate punter.

Regards,
Mike
 
May
First thing to check would the the tag (the very first field)
Many thanks.

See enclosed - my attempts at creating a BB code for anchor looks like - and also for goto

Placing the anchor seems to have partially worked (the BBcode seems to have been accepted since it doesn't show in the post, but I'm not sure an anchor has been created)
However the goto code has also partially worked( the BBcode seems to have been accepted since it doesn't show in the post, a hyperlink has been created containing the word {TEXT2}



Here is how the GOTO looks in the post: Title you want to appear (see {TEXT2}
and here is the full BBcode visible version: Title you want to appear (see [GOTO=Thoughts]Thoughts on adding photos below[/GOTO]

here is how the ANCHOR looks in the post: Thoughts on adding photos
and here is the full BBcode visible version: [ANCHOR]Thoughts[/ANCHOR] Thoughts on adding photos
(I have added italics to try and be clear what is a copy from my site!)
Any clues please?

Regards, Mike
 

Attachments

Thanks for the suggestion. I just tried that too - slightly different results, but it still didn't work - and sadly that thread that did not end up with a "visible" success post:(

Right now its looking like this is not going to work:(
 
I think it should work, but is a bit complicated - it would need two codes , one for link and one for anchor and you'd be relying on users doing it properly.

Simplest would be if the id was just a number not relying on a relevant word. I'll look into it when I get a bit of time. But then the link may be conflicting with xenforo automatic link parsing ????
 
That's kind of you to consider the challenge.
That latest attempt succeeded in creating hyperlinks, but no jumping took place!
Numbers for Links are fine as long as they can be hidden from view.

I am surprised this stuff is not built into XF2, which has so much brilliant code.
Regards and thanks,
Mike
 
Top Bottom