News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Edit bbcode insert hyperlink

Started by electricwildflower, July 05, 2013, 01:34:52 PM

Previous topic - Next topic

electricwildflower

Hello everyone need some support if anyone can help me as i have been looking around the forums and found nothing related unless i havent been looking hard enough anyway i am looking to edit the bbcode insert hyperlink if it's possible or change it to something better.

At the moment when i press the button insert hyperlink on a new topic i will get the usual url between brackets and when i add url and post topic it will come out like below.

https://www.facebook.com/

Is there a possible way to style this better as sometimes i will post links and it will look like below.

www.facebook.com/group/testing_237236463-eww1221_test_1354737467464addededd&^%""xxx_w1212

I would like to change it to act like a standard html link. this way it looks much better having a link saying example facebook which you click instead of a whole url that's clickable. Using the bbcode is easier for my members but i just want it to look and act better ?

Thanks in advanced :)

Mick.


MrPhil

So instead of
[url]https://www.facebook.com/[/url]
which gives

https://www.facebook.com/

you want

Facebook ?

Use
[url=https://www.facebook.com/]Facebook[/url]
It's a bit of manual tweaking of the BBCode, but WYSIWYG ain't worth all that much.

electricwildflower

Thanks for the replys

MrPhil is there anyway i could edit the BBCode it's self so i could change it to match how you wrote the second code. This way when people click the button url it shows up the second code instead of the first.

I was just wondering is there any files or anything i could edit if not ill look into the mod.

Cheers

MrPhil

I know of no way to change the existing [url] BBCode (parse_bbc) to do what I showed. You have to edit the post code in non-WYSIWYG mode to move the first ] to after the URL, insert an =, and add the link text in between the two tags. I thought I saw somewhere a mod that gives a pop-up dialog to ask for both the URL and the link text -- I don't think that's the one that @Mick pointed you to. Are you trying to do all this in WYSIWYG mode, or in regular mode with the BBCode button? It's easy enough to use the existing button and then do a little minor editing in non-WYSIWYG mode.

Chalky


electricwildflower

I just wondered if i could actually edit the bbc code so when they press the bbcode button it shows up the code you posted but seems i carnt do it that way so will have to just add a section on my forums on how to do it in WYSIWYG mode.

Cheers for the help everyone

MrPhil

Without a dialog to ask you two separate pieces of information (the URL and the link text), it's kinda hard to use the regular BBCode button, in either non-WYSIWYG mode. I suppose you could modify the code to present [url=insert URL here]insert link text here[/url], but then your members would have to be careful not to type in either the URL or the link text, highlight it, and click the button, because they would still have to type in the other manually and have a 50:50 chance of entering the wrong one in the first place. If you have a mod to put up a dialog to ask the URL, presumably it would not be a major extension to have it ask the link text too (and if left blank, output [url]URL[/url]).

Advertisement: