I want to embed stylesheets in the JCE Editor iframe only for specific pages, preferably using PHP. Right now, the JCE admin interface allows you to set stylesheets globally and by individual user profile for every instance where JCE is loaded in the admin control panel. However, I am creating custom components that load the editor for display like so:
<?php
$editor = JFactory::getEditor(); // JCE set by default
echo $editor->display();
I want to be able to load different stylesheets based on different sections of my components. As far as I know, this doesn't exist out of the box, so I'd like to see if there's some API method that could help me achieve this.
Something like:
<?php
$editor = JFactory::getEditor(); // JCE set by default
// calculate whether additional styles may be needed...
if (true === $needs_more_stylesheets_bool) {
// Would be nice to do something like
$editor->addStylesheet('specific_styles.css');
// Or
$editor->addInlineStyle('body{background:green}');
// Or
$editor->removeStylesheet('general_styles.css');
// Or... with adding/editing user profiles...
$editor->loadUserProfile('user_2_with_different_stylesheets');
}