After completely rewriting the bi-directional links code and repeatedly breaking the single post page (I'm glad I took a backup as I had to start from scratch at one point) I think I've finally cracked it. Switching back and forth between PHP and JavaScript can be annoying.

If there is only one post linking to a fragment that text just becomes a direct link back out. If, however, more than one post links to the same fragment the text becomes the toggle for a container which, when clicked, lists all links, like this:

Multiple fragmentions

I'll pretty it up a bit at some later stage.

It should cater for multiple fragments in a post and multiple links to each fragment but I'll only find out how robust it is when I have more fragmentions to work with.

Where appropriate, I intend to cross-reference a lot more than I have in the past now that this system is in place.

Leave a Reply

Your email address will not be published.