Adding section templates to topics?

Post here questions and problems related to editing and publishing DITA content.
Glimmerino
Posts: 24
Joined: Mon Aug 24, 2015 11:37 pm

Adding section templates to topics?

Post by Glimmerino »

I would like to add a warning image with belonging text as a template into a topic. This is to speed up my writing, so instead of having to adding the image and the text for each occasion, I would just like to include a "section template" that I can edit for each instance. The text will be different from case to case and thats why I can't use the conref element.
Is there anyway to do this?
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: Adding section templates to topics?

Post by mihaela »

Hi,

What you can do is to create a code template that contains the image reference and a call to the ask editor variable that allows you to enter the text content. Here is an example:

Code: Select all

<p><image href="image_url"/>${ask('Please insert the text:', 'generic', 'default text')}</p>
To define code templates open the Preferences dialog box, go to Editor > Templates > Code Templates options page and use the "New" action.

Here are the details about code templates preferences:
https://www.oxygenxml.com/doc/versions/ ... lates.html

And here you can find explanations about "ask" editor variables:
http://www.oxygenxml.com/doc/versions/1 ... ables.html


Best Regards,

Mihaela
--
Mihaela Calotescu
<oXygen/> XML Editor
Mihaela Calotescu
http://www.oxygenxml.com
Glimmerino
Posts: 24
Joined: Mon Aug 24, 2015 11:37 pm

Re: Adding section templates to topics?

Post by Glimmerino »

Thank you, this was very helpful. Is there any way to add a border around a template (or around a paragraph in general?).

Regards
Kristian
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: Adding section templates to topics?

Post by mihaela »

Hello,

Can you please give me more details about what you need?
You want to see the border when you open the document in Author mode or in the output of a transformation process?
If the transformation is your use-case, tell me please what type is it (PDF, XHTML, ...).

Best Regards,

Mihaela
--
Mihaela Calotescu
<oXygen/> XML Editor
Mihaela Calotescu
http://www.oxygenxml.com
Glimmerino
Posts: 24
Joined: Mon Aug 24, 2015 11:37 pm

Re: Adding section templates to topics?

Post by Glimmerino »

I want to see it in the output as pdf and XHTML.

As I mentioned earlier I want to add a "warning" template. The template looks like:

WARNING

<image
Glimmerino
Posts: 24
Joined: Mon Aug 24, 2015 11:37 pm

Re: Adding section templates to topics?

Post by Glimmerino »

Sorry, my last answer probably didnt make much sense since a accidentaly pushed "Submit" Before I was finished.

What I want as output in pdf and xhtml is:

A rectangular frame with outer border containing the Word "WARNING" and an image of a red triangle. Below the image but still inside the rectangle it shall be possible to insert optional text.

I hope it can be understood.

REgards
Kristian
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: Adding section templates to topics?

Post by mihaela »

Hi Kristian,

In DITA there is a "note" element that you can use to include warning information (it has a type attribute with "warning" as possible value).

If this solution is not right for you, here is what you can do to customize the styling of the elements in the output:

1. For the XHTML transformation you can set the value of the outputclass attribute to the CSS class attribute that will be used in the HTML code to style the node. Here are some details about this attribute:
http://www.oxygenxml.com/dita/styleguid ... ibute.html
The name of the CSS file that will contain the styles for this node class must be specified in the transformation scenario - go to the Parameters tab of the scenario, edit the args.css parameter and set its value to this custom CSS file path.
You can also edit the args.copycss parameter and set it to yes to copy the CSS to the output directory.

2. For the PDF transformation, you can check this topic from our online manual:
http://www.oxygenxml.com/doc/versions/1 ... ation.html

If you need further assistance please let us know.

Best Regards,

Mihaela
--
Mihaela Calotescu
<oXygen/> XML Editor
Mihaela Calotescu
http://www.oxygenxml.com
Post Reply