View Full Version : Create a anchor
derdiedastim
05-07-2010, 11:58 AM
Hi,
it is possible to create an bbcode for anchor in vB 4?
In vB 3 I create an bbcode like this:
<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.
Any ideas? Hacks/Mods?
mariobkk
05-28-2010, 02:33 AM
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: This takes you to a new location within a post
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 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
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
scarex
01-14-2011, 07:38 PM
Did anyone find a solution to this problem?
Digital Jedi
01-14-2011, 08:16 PM
Hi,
it is possible to create an bbcode for anchor in vB 4?
In vB 3 I create an bbcode like this:
<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.
<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.
Useful Tips
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.
http://www.yoursite.com/showthread.php?t=threadid123456#tips
That's it. You really only need one BBCode.
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: This takes you to a new location within a post
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 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
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.
scarex
01-16-2011, 11:46 AM
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.
<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.
Useful Tips
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.
http://www.yoursite.com/showthread.php?t=threadid123456#tips
That's it. You really only need one BBCode.
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.
I Digital Jedi,
I'm using 4.01 PL2 vbulletin, and the problem in using url bbcode referring to an anchor is that the resulting hyperlink in href is something similar to http:///#<anchor-name> that's obviously doesn't work.
Instead, creating an alternative bbcode, which doesn't add "https://", the problem is that browser will redirect to site home page.
Digital Jedi
01-16-2011, 02:19 PM
I Digital Jedi,
I'm using 4.01 PL2 vbulletin, and the problem in using url bbcode referring to an anchor is that the resulting hyperlink in href is something similar to http:///#<anchor-name> that's obviously doesn't work.
Instead, creating an alternative bbcode, which doesn't add "https://", the problem is that browser will redirect to site home page.
Well, obviously if the page isn't https it wont find the page. But I don't see why the other shouldn't be working. I just tried it on my 4.0.1 test board and it worked perfectly. Remember that the BBCode that you posted in the first post will not do what you wanted. You need to use the one I posted
scarex
01-16-2011, 08:21 PM
Well, obviously if the page isn't https it wont find the page. But I don't see why the other shouldn't be working. I just tried it on my 4.0.1 test board and it worked perfectly. Remember that the BBCode that you posted in the first post will not do what you wanted. You need to use the one I posted
I've posted no bbcode in this thread.... anyway your bbcode works good as you are suggesting to use a normale url bbcode where you specificy the entire target url + anchor.
This suggests that I've to post the article, catch the url and then edit it adding the correct reference. Not so friendly...
Instead, I've already the anchor bbcode which place anchor target, but as I said if I use the normal url bbcode with #<anchor-name> as target, engine adds http://
Anyway, thank you :)
Digital Jedi
01-16-2011, 10:41 PM
Sorry, I thought you were the OP.
So your saying, you're trying to put anchors in posts that you haven't posted yet? I presume you're only trying to link to anchors on the same page, because without the full URL, that's all you'd ever be able to do. I've can't a BBCode like that to work, but for different reasons. The one being that it always tries to use my forum URL, rather than the thread I'm on. That's normally the way it should work, though.
scarex
01-17-2011, 07:01 AM
Sorry, I thought you were the OP.
So your saying, you're trying to put anchors in posts that you haven't posted yet? I presume you're only trying to link to anchors on the same page, because without the full URL, that's all you'd ever be able to do. I've can't a BBCode like that to work, but for different reasons. The one being that it always tries to use my forum URL, rather than the thread I'm on. That's normally the way it should work, though.
You're right, my problem is exactly this.
People in our staff who write CMS articles need to use anchor in the same text, in order to refer to different part of the text. I can say them to save the article, catch the url and edit it again putting the correct reference, but I'm figuring out if there was a more friendly mechanism. However, even if without "http://" in front of anchor name, browser redirect on site home page and I don't understand why....
sub_ubi
07-28-2012, 12:05 AM
Fix for VB 4 is here in the original thread https://vborg.vbsupport.ru/showpost.php?p=2352014&postcount=3
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.