Conditional DRAFT watermark

Post here questions and problems related to editing and publishing DITA content.
LASSE_MLE
Posts: 25
Joined: Mon Dec 05, 2022 3:24 pm

Conditional DRAFT watermark

Post by LASSE_MLE »

  • <oXygen/> XML Editor 24.1, build 2022030807
  • "DITA Map WebHelp Responsive" scenario
Hello all,
I try to add a DRAFT watermark on several HTML pages of our internal documentation SharePoint but only for the pages who are really in draft...
For example one topic in the middle of ditamap that contains let's say 10 topics.
I succeed adding the watermark on every page with the corresponding CSS file:

Code: Select all

body {
    background-image: url(draft.png);
}
But now I want to perform this addition only for the topics which embed a dedicated tag on its Prolog/Metadata for example.
I have searched a bit on the forum but I did not find any solution :(
Perhaps someone can help me?
BR,
Mathieu
alin
Site Admin
Posts: 268
Joined: Thu Dec 24, 2009 11:21 am

Re: Conditional DRAFT watermark

Post by alin »

Hello,

You can set the @outputclass attribute on the root element of each topic you want to apply the watermark on. For example:

Code: Select all

<topic id="my-topic" outputclass="watermark">
...
</topic>
The value of the @outputclass attribute will be transferred on the <body> element of the associated output HTML file.
This way you can use specific CSS rules to apply the watermark only on those topics.

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
LASSE_MLE
Posts: 25
Joined: Mon Dec 05, 2022 3:24 pm

Re: Conditional DRAFT watermark

Post by LASSE_MLE »

Ah!
I did not think at all using the outputclass! I was focused on prolog.
Thank you for your help (as always) :)
BR,
ML
Post Reply