• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Text Shadow Custom BB Code help

#1
Hey guys
so on my site i been working on a custom BB code like this [shadow]Text[/shadow]
this would add shadow to the text like in css or html styling like this, [shadow]Shadow'ed text[/shadow] would look like this


So yea i have managed to get it working but i need help, i want to add options for the bb code for different colors, so like so far the default one is just green (as shown above) i want to do that like [shadow=green]Shadow'ed text[/shadow] and a few other colors, in the html replacement box i did span style: text shadow... etc
i set that as green for testing purposes, so can you guys help me add options to it with different colors.. would i need to use php callbacks? if so please specify. :)

Thanks
- Placid
 

Chris D

XenForo developer
Staff member
#3
You would only need a PHP Callback if you wanted to make the option parameter more complicated, but assuming you just want it to be a single colour:

upload_2015-6-29_16-49-12.png

Notice this probably isn't completely correct, but it demonstrates how the {option} parameter can be passed in to the HTML replacement.
 
#5
You would only need a PHP Callback if you wanted to make the option parameter more complicated, but assuming you just want it to be a single colour:

View attachment 109710

Notice this probably isn't completely correct, but it demonstrates how the {option} parameter can be passed in to the HTML replacement.
Ok i got it working but how do i add more than on option? like one option is [shadow=green] how can i do a different one like [shadow=red] ? thnks for your help :)