Page 1 of 1

Editor variables support in CSS for author mode

Posted: Tue Jan 19, 2016 7:39 pm
by stdu
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

Re: Editor variables support in CSS for author mode

Posted: Wed Jan 20, 2016 9:32 am
by Radu
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/ ... ction.html

Regards,
Radu

Re: Editor variables support in CSS for author mode

Posted: Wed Jan 20, 2016 11:43 am
by stdu
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

Re: Editor variables support in CSS for author mode

Posted: Wed Jan 20, 2016 11:47 am
by stdu
Just a little example:

Code: Select all

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

Re: Editor variables support in CSS for author mode

Posted: Wed Jan 20, 2016 1:14 pm
by Radu
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

Re: Editor variables support in CSS for author mode

Posted: Fri Jan 22, 2016 6:59 pm
by stdu
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

Re: Editor variables support in CSS for author mode

Posted: Mon Jan 25, 2016 9:36 am
by Radu
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

Re: Editor variables support in CSS for author mode

Posted: Thu May 05, 2016 11:32 am
by Radu
Hi,

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

Regards,
Radu

Re: Editor variables support in CSS for author mode

Posted: Thu May 05, 2016 7:08 pm
by HomeGoods
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.

Re: Editor variables support in CSS for author mode

Posted: Thu May 05, 2016 7:29 pm
by HomeGoods
Oops. Found it documented.