News:

Wondering if this will always be free?  See why free is better.

Main Menu

Add BBCode editor in theme settings

Started by Boban ツ, August 06, 2018, 08:47:04 AM

Previous topic - Next topic

Boban ツ

How can I add the BBCode buttons in theme settings??

To be like this: https://i.imgur.com/B9EQY05.png

I am insert the textarea in Themes.template, but I want the BBCode buttons.
        elseif ($setting['type'] == 'textarea')
{
echo '
<dt>
<label for="', $setting['id'], '">', $setting['label'], '</label>:';

if (isset($setting['description']))
echo '<br />
<span class="smalltext">', $setting['description'], '</span>';
echo '
</dt>
<dd>
<textarea', array_key_exists('enabled', $setting) ? ($setting['enabled'] ? '' : ' disabled="disabled"') : '', ' rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '','options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>
</dd>';
}



   
   

Arantor

There is no way to make this without actually providing support in the core theme code.

You'd have to write a mod first...

Kindred

What are you ACTUALLY trying to do?

BBC buttons are generated by the list in Subs.php - not in the template code.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

He's trying to add an area in the theme settings that has a BBC editor to alllow someone to make some BBC and put it somewhere into the theme.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

I actually don't have a problem with the idea but SMF doesn't support it without overhauling the theme code.

Not to mention that this potentially raises some security issues if you're not super careful.

Boban ツ

I am making image/text slider on header, with bbcparse and that's why I need that. But it's ok, I will add some other bbcode editor. Thank you for info!.... :D



   
   

Advertisement: