I’m trying to follow along with the rich text editor documentation in expression engine, but it’s a little unclear to me:
http://ellislab.com/expressionengine/user-guide/development/rte_tools.html
I created a php file like this:
Class center_text {
public $info = array(
'name' => 'Center Text',
'version' => '1.0',
'description' => 'Center Aligns Text',
'cp_only' => 'y'
);
private $EE;
/**
* Constructor
*/
function __construct()
{
// Make a local reference of the ExpressionEngine super object
$this->EE =& get_instance();
}
/**
* Globals we need defined
*/
function globals()
{
$this->EE->lang->loadfile('center_text');
return array(
'rte.center_text.label' => lang('center_text')
);
}
/**
* RTE tool Definition
*/
function definition()
{
return '
WysiHat.addButton('center_text', {
label: EE.rte.center_text.label,
handler: function()
{
// Button Logic
}
});
';
}
}
// END center_text_rte class
/* End of file rte.center_text.php */
/* Location: ./system/expressionengine/third_party/center_text/rte.center_text.php */Named and placed as mentioned in the comments. I realize that this wouldn’t exactly do anything just yet (I still don’t know how to make that happen) - but I would expect it to show up as an option now in the toolset of the rich text editor, but it’s not.
Does anyone have an example tool they’ve built for the RTE, or can point me to the default tools so I can see how they’re set up. All I really want to do is define some very simple styles that CMS users can apply to their text, and the css will handle the rest (such as center, left, or right aligning text).
Thanks for any help or clarification on this.