DITA-FMx User Guide

New DITA File

Creates a new DITA map or topic file.

There are two groups of items on the DITA-FMx > New DITA File menu. Items above the divider create a new map file and items below the divider create a new topic file. The number and label text of these items will vary depending on the map and topic structure applications you have selected in the Options dialog. The map items are those elements with a class attribute value of “map/map” and the topic items are elements those with a class attribute value of “topic/topic.”

At the bottom of the “map” area is the command New ‘Map from Outline’ Template. This command creates a new FM file using the “Map from Outline” file as the template. By default, this template is named map-from-outline_template.fm and is in the root of the DITA-FMx structure application folder ($STRUCTDIR\xml\DITA-FMx\). You can specify an alternate template file by changing the MapFromOutlineTemplate parameter in the INIOnly section of the ditafmx.ini file. For more information, see Build Map from Outline and INI-Only Settings.

Figure 1. DITA-FMx New DITA File dialog box

After selecting a menu item the New DITA File dialog displays. This dialog provides a field for entering the title, file name, file path, and element template (optional). For new topics, the title is inserted into the first title element, for maps, the title text is entered as the map/@title attribute or in the map/title element (depending on the DITA version). For new topic files, the file name field is populated based on the value of the New File Name Format setting (in Options: New File Options). If the new file name format includes a building block that includes the title, the file name field will update as you enter text into the title field. For new maps, the file name field does not update automatically. You can optionally select an element template to insert predefined structure and content into the new file.

Entering a folder name into the File Name field will create the new file in the specified folder. If that folder, or folders, do not exist, you will be prompted to allow them to be created.

Tip: You can use building blocks to automatically create new files in folders based on the topic type. For an example, see the New File Options topic.

You can also select the Wrap in Dita Element option to create a topic file that includes the dita element as the root element. This is useful if you are creating files with nested topics, and required if you want to have multiple top-level sibling topics. The default value for this option is defined in the New File Options dialog.

When you choose OK, the file is immediately saved as XML using the name specified. If you don’t provide a file name extension for the new topic file, one is added based on the type specified in the Default File Type option in the Options dialog. DITA map files are given the extension of “ditamap.”

When creating a new topic or map file, if your insertion point is in a DITA map at a location that is valid for a topicref element, you are prompted to insert the new file as a topicref.

Creation of new DITA files differs from the standard FrameMaker “New” command because FrameMaker does not provide a method for creating an “Untitled” XML file (one that is not saved to the file system). If you want to start with an “Untitled” file, select the standard New command (File > New) and use the DITA template as the template file.