Page 1 of 1

othertype notes using different note images

Posted: Fri Apr 19, 2019 4:06 pm
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,

Re: othertype notes using different note images

Posted: Mon Apr 22, 2019 9:03 am
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

Re: othertype notes using different note images

Posted: Tue Apr 23, 2019 4:30 pm
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

Re: othertype notes using different note images

Posted: Wed Apr 24, 2019 12:24 pm
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

Re: othertype notes using different note images

Posted: Thu Aug 15, 2019 4:51 pm
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

Re: othertype notes using different note images

Posted: Fri Aug 16, 2019 4:17 am
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!

Re: othertype notes using different note images

Posted: Fri Aug 16, 2019 12:47 pm
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

Re: othertype notes using different note images

Posted: Fri Sep 20, 2019 3:39 pm
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

Re: othertype notes using different note images

Posted: Tue Sep 24, 2019 12:26 pm
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

Re: othertype notes using different note images

Posted: Tue Oct 15, 2019 8:47 pm
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

Re: othertype notes using different note images

Posted: Wed Oct 16, 2019 8:21 am
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