Editor variables support in CSS for author mode

Are you missing a feature? Request it's implementation here.
stdu
Posts: 81

Editor variables support in CSS for author mode

Tue Jan 19, 2016 7:39 pm

Hi,

we develop and maintain a couple of Oxygen XML Frameworks for our research projects. Recently we're trying to simplify the maintaining of these frameworks by developing a base framework with common features and put all project-specific stuff in an extension framework (BTW: this is a cool feature and works very well).

But we have generally one problem: editor variables cannot be used in CSS for the author mode. If Oxygen XML would evaluate and replace them, we could get a very high flexibility, especially for project-specific URLs or pathes from the extension to the base framework. In all other parts of a framework one could already use editor variables (actions, validations, templates ...).

Perhaps it is possible to integrate such a feature in the future? This would be great!

Kind regards,
Stefan
Radu
Posts: 5867

Re: Editor variables support in CSS for author mode

Wed Jan 20, 2016 9:32 am

Hi Stefan,

I'm glad that you like the framework extension feature, if you find any issues please let us know.
About expanding editor variables, could you give us some precise examples of the places in the CSS where you would like them expanded?
For example the Oxygen oxy_url function expands them:

https://www.oxygenxml.com/doc/versions/17.1/ug-editor/#concepts/dg-url-function.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
stdu
Posts: 81

Re: Editor variables support in CSS for author mode

Wed Jan 20, 2016 11:43 am

Hi Radu,

I didn't know the feature that oxy_url expands editor variables. Really awesome! I think, that make 80% of my feature request obsolete ;-)

But it seems that I cannot use oxy_url in a @import rule (or am I missing something again?). If I could use it there, I could create a CSS with additional rules in the extension framework and import the "base CSS" from the base framework. Or is there a workaround for such a workflow?

Thx,
Stefan
stdu
Posts: 81

Re: Editor variables support in CSS for author mode

Wed Jan 20, 2016 11:47 am

Just a little example:

Code: Select all

@import oxy_url('${baseFramework}', '/css/standard.css');
Radu
Posts: 5867

Re: Editor variables support in CSS for author mode

Wed Jan 20, 2016 1:14 pm

Hi Stefan,

I will add an issue to try and expand editor variables in CSS imports.
As a possible workaround:

1) You can construct your extension's CSS with only the selectors which are different from the base, without imports to the base CSSs.
2) After you extend from the base and edit the document type extension, in the Author->CSS tab you should leave all the CSS references to the base CSSs unchanged. Then you add a new reference to your extension-specific CSS with the same title as the one in the base and the same "alternate" flag. It should be combined with the CSS in the base and used when rendering the XML in the Author mode.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
stdu
Posts: 81

Re: Editor variables support in CSS for author mode

Fri Jan 22, 2016 6:59 pm

Hi Radu,

thanks for the workaround! This sounds good, I'll try it in the next time ...

BTW: I've noticed, that if I remove the path to a template folder in the base framework via an extenstion framework, there is no effect in the author mode. The templates from the base framework a still available. Is this intended?

Thx & regards,
Stefan
Radu
Posts: 5867

Re: Editor variables support in CSS for author mode

Mon Jan 25, 2016 9:36 am

Hi Stefan,

About this question:

BTW: I've noticed, that if I remove the path to a template folder in the base framework via an extenstion framework, there is no effect in the author mode. The templates from the base framework a still available. Is this intended?


Right now the new file templates are gathered from all enabled document type configurations. So you can for example disable the base document type configuration and you will only get new file templates from the extension.
We've already made some changes for Oxygen 18 to automatically filter out new file templates from the base frameworks when the extension has a set of association rules which are a superset of the ones in the base. So if Oxygen will consider that a newly created XML file cannot possibly be matched by a document type configuration (because there are document type configurations which have higher priority and the same association rules) it will avoid presenting new file templates for them.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 5867

Re: Editor variables support in CSS for author mode

Thu May 05, 2016 11:32 am

Hi,

Just to update this thread, Oxygen 18.0 should allow expansion of editor variables in the CSS imports.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
HomeGoods
Posts: 87

Re: Editor variables support in CSS for author mode

Thu May 05, 2016 7:08 pm

Thanks for the great news, Radu.
Could you show us an example @import line with the editor variables? In particular, I'm not sure if oxy_url() is necessary or not.
HomeGoods
Posts: 87

Re: Editor variables support in CSS for author mode

Thu May 05, 2016 7:29 pm

Oops. Found it documented.

Return to “Feature Request”

Who is online

Users browsing this forum: No registered users and 4 guests