Changing location of skin.css file

Post here questions and problems related to editing and publishing DITA content.
Anonymous1

Changing location of skin.css file

Post by Anonymous1 »

Hi,

we use the WebHelp Responsive to release WebHelp manuals for several of our products. At the moment, each product has its own skin.css file that is located in the webhelp template folder of each product.

Is it possible to make the output look at another location for the skin.css file? We only want to have a single skin.css on our server to be able to apply .css changes to all our WebHelps at the same time. Can I customize this somewhere in the WebHelp framework?

Best regards,

Benjamin
bogdan_cercelaru
Posts: 222
Joined: Tue Jul 01, 2014 11:48 am

Re: Changing location of skin.css file

Post by bogdan_cercelaru »

Hi Benjamin,

Unfortunately you cannot change/set the location of the skin.css file using the current implementation.
As a workaround, you could try to use symbolic links on your web server that points to a common skin.css. To do this, you have to replace the skin.css file in every webhelp output with a symbolic link that points to the common skin.css file.

Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Anonymous1

Re: Changing location of skin.css file

Post by Anonymous1 »

Thanks for you answer. That's disappointing then. Maintaining multiple WebHelp outputs will require a lot of manual work if we have to replace files in each output.

Could we maybe use the args.cssroot paramter for this?
bogdan_cercelaru
Posts: 222
Joined: Tue Jul 01, 2014 11:48 am

Re: Changing location of skin.css file

Post by bogdan_cercelaru »

Hello,

According to DITA-OT Documentation, the args.cssroot parameter is used to:
Specifies the source directory that contains the custom .css file.
In your case, you could try to use the args.csspath parameter to specify the destination directory for the CSS specified with the args.css and args.copycss parameters. Please note that in this case the value of the args.csspath parameter should be relative to the output directory and it can be set to be copied outside of the output directory (e.g: ../custom_css_directory).

Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Anonymous1

Re: Changing location of skin.css file

Post by Anonymous1 »

I'm afraid we need to be able to set an absolute path to a CSS file.

Is there a way to implement a line into the <head> of the HTML-output of each topic?
bogdan_cercelaru
Posts: 222
Joined: Tue Jul 01, 2014 11:48 am

Re: Changing location of skin.css file

Post by bogdan_cercelaru »

Hello,

You can add an absolute path to a CSS file by editing the template files and replace the

Code: Select all

<whc:webhelp_skin_resources/>
with HTML element that links the required CSS file. e.g:

Code: Select all

<link rel="stylesheet" type="text/css" href="absolute_url_to_css_file" />
The template files that have to be modified are:
- ${DITA_OT_DIR}/plugins/com.oxygenxml.webhelp/templates/dita/bootstrap/wt_index.html
- ${DITA_OT_DIR}/plugins/com.oxygenxml.webhelp/templates/dita/bootstrap/wt_search.html
- ${DITA_OT_DIR}/plugins/com.oxygenxml.webhelp/templates/dita/bootstrap/wt_terms.html
- ${DITA_OT_DIR}/plugins/com.oxygenxml.webhelp/templates/dita/bootstrap/wt_topic.html

The "absolute_url_to_css_file" could be also a root-relative URL.

Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Anonymous1

Re: Changing location of skin.css file

Post by Anonymous1 »

Great! That's just what I needed. Thank you.
Post Reply