Community specific external stylesheets in Ephox EditLive

We have multiple communities with each one having a dedicated CSS file defined.

We would need to apply these external stylesheets to the EditLive Ephox control so users have access to community specific formatting through the select box on the content editor.

There is only one EditLive configuration file.

How do I apply a specific external stylesheet to a content editor in a specific community?:confused:

I have checked the available documentation for ephox and was not able to find an answer for this one.

Appreciate your help.
Thanks

In the EditLive Control Properties in Content Editor you can enter specific configuration file location using the config_src_url parameter. So, for Content Types in one community you can apply one config file (in which you specify the appropriate CSS), and then create another config file for another community (in which you specify a different CSS).

Sounds good.
BUT, I get an error when I try to open an editor that is using the config_src_url (parameter pointing to custom config file which is basically a copy of original elj_config.xml).

The error in the content editor, located where EditLive should initialize, is:
An error occurred while initialising. Please see Java console for details.

The error in the Java console is:

Failed to load XML file.
java.net.MalformedURLException: no protocol: ā€¦/sys_Ephox_support/config.xml?config=http://rythdev01:9992/Rhythmyx/rx_resources/ephox/agfis_config.xml&field=body&sys_lang=en-us&isReadOnly=no
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at com.ephox.editlive.common.EditorCommandHandler.initWithURL(EditorCommandHandler.java:611)
at com.ephox.editlive.applets.ELJApplet.jbInit(ELJApplet.java:401)
at com.ephox.editlive.applets.ELJApplet.doInit(ELJApplet.java:376)
at com.ephox.editlive.applets.ELJApplet$2.run(ELJApplet.java:326)

Any help is welcome.
Regards,

It looks like you are trying to use the following full URL:

http://rythdev01:9992/Rhythmyx/rx_resources/ephox/agfis_config.xml

Try to just use the url without the protocol and server/port like this:

/Rhythmyx/rx_resources/ephox/agfis_config.xml

Format required by Rx is ā€œā€¦/applicationName/resourceNameā€ so Iā€™m not putting in the protocol and the server.

Iā€™ve tried different permutations of the parameter (incl. your suggestion) and can not get it to work.
It seems Rhythmyx tacks on protocol://server:port part to anything you specify for config_src_url.

So, the question is how to get around it?

Here it is.

We used sys_MakeAbsLink to specify the path to the config file in Rx 5.6, but now (at Rx 6.1) there is no need to use the exit but just specify the literal value to the config file.

Something like this works fine: ā€¦/rx_resources/ephox/custom_elj_config.xml

Thanks to tech support.

Igor,
This is exactly what Iā€™ve been wanting to do, can you give me some more detail as to what you did? Sorry Iā€™m still new to Rhythmyx.

We solved this problem with the following:

Some of our content types are shared between communities, so we couldnā€™t just hard code the path to the correct configuration, it needed to be dynamic, so on each editlive field, we went into the control properties and setup a parameter for the config_src_url for the value we chose a user defined function. In the function properties dialogue we chose sys_Concat. (We initially started with PSOConcatOnCreate but Iā€™m not sure if thatā€™s a standard function given the PSO prefix in the name, and sys_Concat seems more appropriate)
for the parameters, we used:

P1: (literal) ā€œ/Rhythmyx/rx_resources/ephox/elj_config_ā€
P2: (user context) ā€œUser/SessionObject/sys_communityā€
P3: (literal) ā€œ.xmlā€

This results a unique file for each community with a filename ā€œelj_config_1234.xmlā€ where the number represents the community ID.

Given that we have an admin community AND a regular community setup for each site, this required us to actually create (2n) config files per site, but in some cases the admin community has different ephox needs anyway, so it actually works out nicely. The only downside to this is that this function has to be applied individually to each edit live field for each content type, which becomes a major pain in the butt for the initial setup, but moving forward, itā€™s easy enough to copy the configuration from an existing one to the new one.

Hope this is helpful.

-J