Page 1 of 1

Referencing an external CSS

Posted: Fri Dec 28, 2018 3:50 am
by mdslup
Referencing an external CSS

I am using Oxygen 20.0, Webhelp Classic.

Imagine this scenario:

Our company makes a product and provides an online manual. The product is then sold by 3 separate companies, who want a "customized" version of the manual with their own branding.

To handle this, I set up a server with 3 different directories. Each directory represents a different company. Each directory contains 3 files: CompanyLogo.png, CompanyCSS.css, and CompanyFavicon.png. So here is the structure of the server:

/
-->Company1
---->CompanyLogo.png
---->CompanyCSS.css
---->CompanyFavicon.png
-->Company2
---->CompanyLogo.png
---->CompanyCSS.css
---->CompanyFavicon.png
-->Company3
---->CompanyLogo.png
---->CompanyCSS.css
---->CompanyFavicon.png

I want to generate the manual ONCE, then upload the output files to each directory and have the logo, css, and favicon take effect.

==Logo==

I can set the webhelp.logo.image parameter to "CompanyLogo.png"; I have tested and verified this works.

==CSS==

What transformation parameter should I use to specify the relative path to the CSS on the server? Because each CompanyCSS.css file is different, I do not want to associate a particular CSS to my transformation scenario; I only want to point to where it will be. I tried both args.css and args.csspath, but neither worked.

==Favicon==

Similar to the CSS above, I do not want to associate a favicon with a transformation scenario, I only want to reference where it will be.


Thanks.

Re: Referencing an external CSS

Posted: Thu Jan 03, 2019 3:40 am
by mdslup
Does the problem make sense how I have described it?

Re: Referencing an external CSS

Posted: Tue Jan 08, 2019 1:59 pm
by bogdan_cercelaru
Hello,

You could achieve this using the webhelp.head.script parameter that points to an XML file like the one below:

Code: Select all

<head>
<link rel="stylesheet" type="text/css" href="${oxygen-webhelp-output-dir}/CompanyCSS.css" />
<link rel="icon" href="${oxygen-webhelp-output-dir}/CompanyFavicon.png" type="image/x-icon" />
<link rel="shortcut icon" href="${oxygen-webhelp-output-dir}/CompanyFavicon.png" type="image/x-icon" />
</head>
In this case, the ${oxygen-webhelp-output-dir} macro will be expanded to a path relative to the output directory so that it will point to the

Code: Select all

CompanyCSS.css
file located where the generated output will be copied.

Regards,
Bogdan

Re: Referencing an external CSS

Posted: Thu Jan 10, 2019 3:44 am
by mdslup
I should have thought of that!

OK, so I note that this puts a custom head into the HTML pages of topic files. Is there a way to put custom code in the HEAD of the *main* page?

Re: Referencing an external CSS

Posted: Wed Jan 16, 2019 12:10 pm
by ionela
Hi,

Unfortunately, it is not possible to put the custom code in the HEAD section of the main page.

Regards,
Ionela