Referencing an external CSS

mdslup
Posts: 90

Referencing an external CSS

Fri Dec 28, 2018 3:50 am

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.
mdslup
Posts: 90

Re: Referencing an external CSS

Thu Jan 03, 2019 3:40 am

Does the problem make sense how I have described it?
bogdan_cercelaru
Posts: 207

Re: Referencing an external CSS

Tue Jan 08, 2019 1:59 pm

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
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
mdslup
Posts: 90

Re: Referencing an external CSS

Thu Jan 10, 2019 3:44 am

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?
ionela
Posts: 243

Re: Referencing an external CSS

Wed Jan 16, 2019 12:10 pm

Hi,

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

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 4 guests