othertype notes using different note images

Post here questions and problems related to editing and publishing DITA content.
Ronser
Posts: 13
Joined: Thu Apr 12, 2018 5:33 pm

othertype notes using different note images

Post by Ronser »

Hi,

I have a requirement for notes to use different images depending on what regulatory body they are following. For example, one warning label must have "Warning" and an ISO style symbol and another warning label must have "WARNING" (all caps) and a P65 warning symbol. These warnings symbols are different. What's the best solution for this?

For this instance, I used the @other and @othertype attributes:

Code: Select all

<note othertype="WARNING" type="other"/>
I then changed the "other" image for @type to the correct symbol. So that works for 1 instance, but what if I have another case. Is it possible to add a new warning @type to render with the relevant image? Something like this?

Code: Select all

<note type="warningP65"></note>
Thanks for your help,
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: othertype notes using different note images

Post by Radu »

Hi,

According to the DITA 1.3 specification the note type has a fixed set of values.
So I think you did good using the "othertype" attribute to specify your custom type:

https://www.oxygenxml.com/dita/1.3/spec ... /note.html

Maybe you can create a code template to fast insert such notes:

https://www.oxygenxml.com/doc/versions/ ... ting2.html

or add a custom Author action on the toolbar.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Ronser
Posts: 13
Joined: Thu Apr 12, 2018 5:33 pm

Re: othertype notes using different note images

Post by Ronser »

Hi,

Thanks Radu.

I have set the "other.svg" image that I use when type="other" is entered. However, I can't customise further based on the @othertype? Like I said, for different standards they have different symbols. I may have three "warning" style notes all needing a different symbol... :(

At the moment I have the standard type="warning" supporting one standard, type="other" supporting another symbol standard... I can't customize further based on type="other" + @othertype value, for other standards?

Thanks again
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: othertype notes using different note images

Post by Radu »

Hi,

Yes, so you can customize the icon further depending on the @othertype attribute value.
If you do not know how to do that, maybe you can tell us for what output format you want to make the customization and how you customized it so far.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
BobbyG66
Posts: 37
Joined: Tue Oct 15, 2013 11:35 pm

Re: othertype notes using different note images

Post by BobbyG66 »

Ronser,

Is this related to Proposition 65? If so, I have the same issue.
They use the yellow triangle for the warning symbol. Our current format is for all warning types to be gray. So we need another option.
We are just adding the symbol inline, so the styling looks a lot different.

I was wondering about customizing the fastpath note type? We don't use it for anything now, not sure if anyone does. We could change the symbol and the text displayed, which could also be translated.
My only concern is if it is removed from DITA in the future.

The other option was to create a whole new Note type, which should be possible, but not sure how involved or complicated that may be.
We just need the one note type for now, but that be an option if you need more like you do.

I will look into the @othertype attribute.

Thanks
Bob
lhsihan
Posts: 35
Joined: Thu Aug 15, 2019 5:31 pm

Re: othertype notes using different note images

Post by lhsihan »

Hi Ronser,
Could you please help explain the detailed steps for "I have set the "other.svg" image that I use when type="other" is entered. " . How can you get that done?

Thanks a lot!
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: othertype notes using different note images

Post by Radu »

Hi,

None of the two recent posters indicated what type of published format they obtain from DITA. I will assume they generate PDF using the classic XSL-FO approach (and not the HTML and CSS-based PDF publishing which is easier to customize via CSS).
There is a publishing plugin which may serve as an example about how the new note icons can be added:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\com.oxygenxml.pdf.custom

This plugin has a build_custom.xml which copies all the new icon files to the corresponding output folder and a custom.xsl which matches the DITA <note> element and depending on the @type and @othertype can decide what icons to use.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
BobbyG66
Posts: 37
Joined: Tue Oct 15, 2013 11:35 pm

Re: othertype notes using different note images

Post by BobbyG66 »

Thanks Radu,

Yes, I am publishing to PDF with classic XSL-FO.
This looks like a great solution, but need a little more help.

We have multiple plugins for our different brands of products. Do we edit the main org.dita.pdf2 plugin?
I placed the build_custom.xml file in the root folder of org.dita.pdf2 and added it to the plugin.xml file.

So where do we put the code from the custom.xml file? <!--Custom Oxygen note images for PDF-->

Thanks
Bob
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: othertype notes using different note images

Post by Radu »

Hi Bob,

You should try to do this as a separate DITA OT plugin, as the "com.oxygenxml.pdf.custom" is constructed, without making direct changes to the base PDF plugin.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
BobbyG66
Posts: 37
Joined: Tue Oct 15, 2013 11:35 pm

Re: othertype notes using different note images

Post by BobbyG66 »

I was hoping to get this new warning into the dropdown menu of warning types, but I could not get it to work.

We only needed one custom warning, So I just used the stock settings for "other" and modified the artwork path.

Code: Select all

<variable id="other Note Image Path">Customization/OpenTopic/common/artwork/Prop_65.png</variable>
This was a pretty simple solution and it's working for us now.
Thanks for all your help!
Bob
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: othertype notes using different note images

Post by Radu »

Hi Bob,

About this remark:
I was hoping to get this new warning into the dropdown menu of warning types, but I could not get it to work.
There are a couple of ways to do this for DITA:

https://blog.oxygenxml.com/2015/07/cont ... -your.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply