[How To] Create HTML anchors using bbcode
Overview
HTML anchors are links that allow you to jump to a specific place within a document. This is very handy for long documents that have headings or other sections of interest to the reader. Typically, the top of the document contains a set of links to each section, and you need only to click one of those links to jump to the desired location on the page. Anchors would be just as useful in forums for those who want to make long posts, perhaps for tutorials, forum guidelines or similar types of posts. Since most, if not all vBulletin license holders do not allow HTML in their forums, here is way to create anchors using bbcode instead of HTML. Instructions First, you need to create two new bbcodes. Start by going to: Admin CP -> Custom BB Codes -> Add New BB Code Then fill in the relevant fields using these settings and parameters: Title: Anchor link Tag: jumpto Replacement: <a href="#{option}">{param}</a> Example: [jumpto=aname]This takes you to a new location within a post[/jumpto] Description: The [jumpto] tag allows you to jump to another location within a post, usually used for long posts with headings and/or sections of interest. This tag <b>must</b> be used in conjunction with the [aname] tag. One is not functional without the other. Use {option}: Yes Click Save Create another bbcode using these settings and parameters: Title: Named anchor link Tag: aname Replacement: <a name="{option}">{param}</a> Example: [aname=aname]This is where you jump to[/aname] Description: The [aname] tag is used in conjunction with the <a href="#jumpto">[jumpto]</a> tag. One is not functional without the other. Use {option}: Yes Click Save Implementation Wrap the [jumpto] tag around a link that will take the reader to another place within the post, as follows: Code:
[jumpto="anchor1"]link to somewhere within the post[/jumpto] Code:
[aname="anchor1"]This is where you end up[/aname] And yes, you can use these same tags for "back to top" links. Wrap the following tags around the first word of the post: Code:
[aname="top"]first word of your post[/aname] Code:
[jumpto="top"]back to top[/jumpto] |
thanks !!
|
For VB 4 on the Title: Anchor link
Code:
<a href="#{option}">{param}</a> Code:
<a href="{relpath}#{option}">{param}</a> |
I am a newbie in this world
I like those bbcode :) |
Quote:
|
Relpath (relative path) sets the Forum Path to the Post/Blog adress and adds the" #anchor-name" after it.
For example, the result is: PHP Code:
PHP Code:
Btw...if you use the BBCode via the editor it will ask for "option"....this "option" is the anchor name or ID. You need to give it a name, otherwise it won't work. |
All times are GMT. The time now is 08:14 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|