Quote:
Originally Posted by derdiedastim
Hi,
it is possible to create an bbcode for anchor in vB 4?
In vB 3 I create an bbcode like this:
HTML Code:
<a href="#{option}">{param}</a>
But this doesn't work with vB 4. I think it is because of the "base"-tag in the source-Code.
|
This is not an actual anchor. This will create a
link to an anchor, and only within the same page. Look at your herf attribute. If you don't put anything but #{option} then it's just going to look for the anchor name on the same page. It would need to include the URL of the page the anchor is on to do go somewhere else. Really, you don't need special BBCode for that. Just link to your anchor the way you would normally.
But like I said, you need an anchor to link to. You would need BBCode that creates the actual
anchor name you want to link to, not the other way around.
Code:
<a name="{option}">{param}</a>
So you'd make a post that has the anchor in it. Let's say you named the BBcode ANCHOR.
Code:
[ANCHOR="tips"]Useful Tips[/ANCHOR]
Then when you want to link to that anchor, you just post a normal link with the anchor appended to the end of the URL.
Code:
http://www.yoursite.com/showthread.php?t=threadid123456#tips
That's it. You really only need one BBCode.
Quote:
Originally Posted by mariobkk
I try to create anchors as well, but it doesn't work. When clicking on the anchor link I get redirected to the starting page of CMS, but not the anchor point within the post.
I created custom BB Codes as follows already, but it doesn't work:
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
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
Any help would be highly appreciated.
Thank you
|
I don't know where you got these, but you don't need the href one, the one that creates links. You can just link to the anchor normally. Just like I said above, the link you're creating would only link to an anchor if happens to be on the same page as the link.