MyBB Community Forums

Full Version: Bookmarking within a post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys i'm new to mybb forums 

This might be a stupid question but how do i create a bookmark within a post?, for example.

I have index at the top of my post If i click item 1 it takes me to that paragraph in the post other words make a clickable index.

1. Item 1
2. Item 2 

1. Item 1 
some content 

2. Item 2
Some content 

Thanks for the help in advance
What you want seems to be something like a TOC in which each title is linked to a heading anchored in the post content.

AFAIK, MyBB doesn't support this feature natively and it's also a bit difficult for plugins to achieve this.
You can achieve this using a custom MyCode, e.g.:

Regular Expression:
\[ANAME=(.*?)\](.*?)\[/ANAME\]
Replacement:
<a name="$1">$2</a>

With this MyCode you can create URLs in your TOC and link to the same thread URL with an anchor appended. Then use this new MyCode to create an named link to the Title of your content:

TOC:
[URL=https://example.com/thread-123.html#toc1]Item 1[/URL]
[URL=https://example.com/thread-123.html#toc2]Item 2[/URL]
[URL=https://example.com/thread-123.html#toc3]Item 3[/URL]
...
[ANAME=toc1]Title of item 1[ANAME]
Content to item 1

[ANAME=toc2]Title of item 2[ANAME]
Content to item 2

...

That should fit your needs.

[ExiTuS]
Thanks a mil guys will give it a go Smile