Gonanda
Well-known member
Dear @cclaerhout, please, read this.
No time "now" and probably for a few weeks to look inside the code.Dear @cclaerhout, please, read this.
You mean with Redactor or MCE4? With MCE4 and this framework it should be really really easy. You can read this, it will help. With Redactor you need to check the html code and get the button class. It should be like this: .redactor_btn_bbm_yourBbCodeTag. You need to create your own sprite (image with several icons) and then use css to set the position of your icon in the sprite. You can also use the xenForo default sprite and play with this code (move background position):
To be clear, with the previous version of this addon nobody seems to have use the css option. That's why I'm happy to use the MCE4 fonts icons that avoid all this process.Code:.redactor_toolbar li a.redactor_btn_bbm_yourBbCodeTag { background-position: 3px -2749px; }
.redactor_toolbar li a.redactor_btn_bbm_ex,
.redactor_toolbar li a.redactor_btn_bbm_ex:hover
{
background-image: url("http://metabunk.org/files/ex-icon.png");
background-position: 0px 0px;
}
Error Info
ErrorException: Array to string conversion - library/BBM/BbCode/Formatter/Base.php:344
Generated By: Unknown Account, Today at 7:18 AM
Stack Trace
#0 /home/site/public_html/library/BBM/BbCode/Formatter/Base.php(344): XenForo_Application::handlePhpError(8, 'Array to string...', '/home/site...', 344, Array)
#1 [internal function]: BBM_BbCode_Formatter_Base->replacementMethodRenderer(Array, Array, Object(BBM_BbCode_Formatter_Base))
#2 /home/site/public_html/library/XenForo/BbCode/Formatter/Base.php(646): call_user_func(Array, Array, Array, Object(BBM_BbCode_Formatter_Base))
#3 /home/site/public_html/library/BBM/BbCode/Formatter/Base.php(546): XenForo_BbCode_Formatter_Base->renderValidTag(Array, Array, Array)
#4 /home/site/public_html/library/XenForo/BbCode/Formatter/Base.php(557): BBM_BbCode_Formatter_Base->renderValidTag(Array, Array, Array)
#5 /home/site/public_html/library/XenForo/BbCode/Formatter/Base.php(481): XenForo_BbCode_Formatter_Base->renderTag(Array, Array, 0)
#6 /home/site/public_html/library/XenForo/BbCode/Formatter/Base.php(462): XenForo_BbCode_Formatter_Base->renderTreeElement(Array, Array, 0)
#7 /home/site/public_html/library/XenForo/BbCode/Formatter/Base.php(442): XenForo_BbCode_Formatter_Base->renderSubTree(Array, Array)
#8 /home/site/public_html/library/XenForo/BbCode/Parser.php(505): XenForo_BbCode_Formatter_Base->renderTree(Array, Array)
#9 /home/site/public_html/library/XenForo/BbCode/TextWrapper.php(113): XenForo_BbCode_Parser->render(Array, Array)
#10 /home/site/public_html/library/DigitalPointAdPositioning/ViewPublic/Thread/View.php(34): XenForo_BbCode_TextWrapper->__toString()
#11 /home/site/public_html/library/XenForo/ViewRenderer/Abstract.php(227): DigitalPointAdPositioning_ViewPublic_Thread_View->renderHtml()
#12 /home/site/public_html/library/XenForo/ViewRenderer/HtmlPublic.php(67): XenForo_ViewRenderer_Abstract->renderViewObject('XenForo_ViewPub...', 'Html', Array, 'thread_view')
#13 /home/site/public_html/library/XenForo/FrontController.php(572): XenForo_ViewRenderer_HtmlPublic->renderView('XenForo_ViewPub...', Array, 'thread_view', NULL)
#14 /home/site/public_html/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#15 /home/site/public_html/index.php(13): XenForo_FrontController->run()
#16 {main}
Request State
array (size=3)
'url' => string 'http://www.site.com/temas/participa-la-foto-del-mes-agosto-2010-tema-minimalista-votaciones-abiertas.162262/' (length=111)
'_GET' =>
array (size=1)
'/temas/participa-la-foto-del-mes-agosto-2010-tema-minimalista-votaciones-abiertas_162262/' => string '' (length=0)
'_POST' =>
array (size=0)
empty
Hi,
A simple question - sorry if it's already been answered: how do I get an image for a button?
I already have the buttons in place on the standard 1.2 XF button set, but I can't seem to find an option to let me put a simple image as the button.
That's what I see on mine too.When adding the spoiler to the Redactor bar, the button picture is sort of a three line looking thing and you can't really tell what the hell it is. Any way to fix that?
Right, but if we've selected the 'Text' button option, why does that appear? I tried the H2 demo and that has the same button, even though it is set up as a text button.The three line thing is because it defaults to the middle of the the toolbar image:
http://xenforo.com/community/styles/default/xenforo/editor/icons.png?redactor
You need to either set the position to an existing icon, like:
background-position: 3px -2397px;
for the smiley button, or make your own button, like I did above.
Ok, makes sense, thanks. So if we're using the 1.2 XF standard one (Redactor), what's the easiest way to get a unique button (text or image, I don't really mind)?I believe it is just because text buttons don't work with Redactor, they work with the other editor.
Ok, makes sense, thanks. So if we're using the 1.2 XF standard one (Redactor), what's the easiest way to get a unique button (text or image, I don't really mind)?
I also had to set a hover state, like (for a button tag "ex")
Code:.redactor_toolbar li a.redactor_btn_bbm_ex, .redactor_toolbar li a.redactor_btn_bbm_ex:hover { background-image: url("http://metabunk.org/files/ex-icon.png"); background-position: 0px 0px; }
We use essential cookies to make this site work, and optional cookies to enhance your experience.