Changing location of skin.css file

B-E-N
Posts: 123
Joined: Thu Mar 24, 2016 5:54 pm

Changing location of skin.css file

Post by B-E-N » Tue Dec 13, 2016 11:46 am

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: 214
Joined: Tue Jul 01, 2014 11:48 am

Re: Changing location of skin.css file

Post by bogdan_cercelaru » Wed Dec 14, 2016 4:06 pm

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

B-E-N
Posts: 123
Joined: Thu Mar 24, 2016 5:54 pm

Re: Changing location of skin.css file

Post by B-E-N » Wed Dec 14, 2016 6:07 pm

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: 214
Joined: Tue Jul 01, 2014 11:48 am

Re: Changing location of skin.css file

Post by bogdan_cercelaru » Fri Dec 16, 2016 4:20 pm

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

B-E-N
Posts: 123
Joined: Thu Mar 24, 2016 5:54 pm

Re: Changing location of skin.css file

Post by B-E-N » Thu Dec 22, 2016 1:36 pm

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: 214
Joined: Tue Jul 01, 2014 11:48 am

Re: Changing location of skin.css file

Post by bogdan_cercelaru » Thu Dec 22, 2016 6:00 pm

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

B-E-N
Posts: 123
Joined: Thu Mar 24, 2016 5:54 pm

Re: Changing location of skin.css file

Post by B-E-N » Fri Dec 30, 2016 4:05 pm

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

Post Reply