Definition Lists and List Enhancements
Although Contributor has always supported definition lists, in previous versions you needed to use the Internal Text Editor to create them. Now, Contributor provides user interface options and shortcuts to help you create definition lists much more easily. There have also been many other enhancements to lists in general, making them easier to create and manage.
[Mini-TOC Proxy — Online — Depth1]
Definition Lists
A definition list is used to create a group of terms and definitions. It is also sometimes referred to as a description list, and although it is called a "list," it does not have bullets or numbers. Instead, it is similar to a table that doesn't have borders (although it can have borders, shading, etc. if you edit the necessary styles).
Definition List Tags and Styles
A definition list contains the following tags, which use corresponding styles to control their look.
- dl This refers to a definition list, which is the container holding the individual terms and definitions.
- dt This refers to a term in a definition list.
- dd This refers to a definition in a definition list.
Example You might create a definition list that initially looks like this:
Then you add these definition list styles to your stylesheet:
dl
{
width: 520px;
padding: 0;
border-bottom: solid 1px #000000;
}
dl dt,
dt
{
clear: left;
float: left;
width: 100px;
margin: 0;
padding: 5px;
border-top: solid 1px #000000;
font-weight: bold;
}
dl dd,
dd
{
margin: 0;
padding: 5px;
border-top: solid 1px #b9bec1;
margin-left: 100px;
}
dt + dd
{
border-top: solid 1px #000000;
}
As a result, the definition list (and others that you create in the project) will look like this instead:
Definition Lists and Context
By using definition list tags—as opposed to different markup, such as headings and regular paragraphs—you are providing context for the content. In other words, not only do end users recognize they are looking at a list of definitions and terms, but this kind of semantic markup allows meta data to be associated with it. Therefore, that information can more easily be extracted automatically.
Snippets and Definition Lists
One of the benefits of creating a definition list instead of using a table has to do with snippets. While creating snippets for parts of a table can be quite difficult, if not impossible, producing snippets from parts of a definition list is easy.
Therefore, when you see a definition list in a document, it might be made up of one or more snippets.
How to Create a Definition List
- Place your cursor in the XML Editor where you want to begin the list.
-
From the Home ribbon, click the down arrow in the list button , and select Definition List.
The structure bars to the left indicate that you have a <dl> (list) tag and a <dt> (term) tag within it.
-
Type the term and press ENTER.
Now you see another structure bar representing a <dd> (definition) tag.
-
Type the definition and press ENTER.
Another <dd> tag is created, in case you want to add another definition line for the term.
- Do one of the following:
- Add Another Definition Type the definition, then press ENTER.
- Add Another Term Press ENTER (which changes the line from a <dd> tag to a <dt> tag), then type the term.
- Exit Definition List Press ENTER twice (which places the cursor on a new <p> tag).
- Click to save your work.
Other List Enhancements
Paragraph Tags Inside All List Items
Previously, all bulleted and numbered list items started out as simple items (i.e., containing only an <li> tag). You could add paragraph items (i.e., <p> tags within <li> tags), but you need to do this manually for each list item.
Now, the default behavior for bulleted and numbered lists is to automatically add a <p> tag inside each <li> tag.
This is a useful approach if you tend to add a lot of information between list items, such as images, notes, or just paragraphs.
If you are a long-time Contributor user, one of the main changes you will notice is that pressing ENTER at the end of a list item that has a <p> tag does not result in an empty line where you can immediately enter additional content between steps. Instead, the new line has a new number or bullet. When your cursor is on an empty list item (or at the beginning of a line that contains text), just press BACKSPACE to remove the number or bullet and enter content between list items.
Although adding paragraph tags is the default behavior, you can still manually set individual list items to the simple format (i.e., an <li> tag with no <p> tag).
Floating Icon and Options
When creating a new list, you will see a floating icon below the first item. After clicking this icon, you can select options from a context menu to set paragraph or simple items, merge lists, or access default settings.
Paragraph and Simple Items
If the new list is not next to another list of the same type, options display that let you choose to add a <p> tag inside the list tag (if one does not already exist), or remove a <p> tag, making it a simple item.
Merging Lists
If you create a new list next to another one of the same time (e.g., two bulleted lists, two numbered lists), a floating icon displays. You can click the down arrow to display options for merging the lists together or to keep them separate.
Note If you have a bulleted list next to a numbered list, you can merge them together after right-clicking the ul or ol structure bar and selecting Merge With Previous List or Merge With Next List. However, if you have a bulleted or numbered list next to a definition list, you cannot merge those together.
Default Settings
Some authors might prefer the previous behavior, where list items do not contain <p> tags initially. Therefore, Contributor lets you set the default behavior according to your tastes and needs. This can be done by clicking the floating icon when you start a new list, and clicking Set Default.
This opens the Options dialog, where you can choose your default setting.
For definition lists, the default behavior is to not include <p> tags within the individual <dt> and <dd> tags. This is probably the most common way to work with definition lists. However, you can change the setting in the Options dialog for definition lists if you want the terms and definitions to include <p> tags.
And you will notice many other new options in this dialog for setting defaults for various features. You could set these defaults in previous versions of Contributor, but these fields in the Options dialog are new.
Sorting
Previously, there was one "Sort List" option available from the context menu when right-clicking a list structure bar. This always sorted the list in ascending order. However, now you can choose from the following options:
-
Ascending
-
Descending
-
Sort at Build This option displays a submenu with the same Ascending and Descending options. If you select one of these options, Contributor will sort the list automatically when you build output. For example, this might be a useful option if you always want a particular list sorted, but multiple authors are working on the list over a period of time, and you want to ensure that the last author making edits does not forget to sort the list. Translation is another reason to sort lists at build time. Because languages use different characters, this ensures that the list in each output is sorted appropriately.
Another change you might notice is that when sorting a list that includes numbers in the content, the value is now sorted instead of the digit.
Example You have a list like this, with a number at the beginning of each bullet to represent some kind of code.
You want to sort the list so that it shows each description according to its code value.
After sorting the list, instead of this…
… you will get this.
List Shortcuts
Some of the following shortcuts already existed, but some are new.
Add Another Definition <dd> to Definition List |
ENTER (press at end of <dd> tag containing text) |
Add New Term <dt> to Definition List |
ENTER (press at end of empty <dd> tag) |
Create Paragraph or Simple Item in List (Toggle) |
CTRL+; |
Exit Bulleted or Numbered List |
ENTER (press x2 on last line) |
Exit Definition List |
ENTER (press x3 on last line, at end of final <dd> tag) |
Indent List Item |
TAB |
Outdent List Item Remove List Tag and Convert to Paragraph |
SHIFT+TAB |
Edit Custom List Format Option
There is a new option in the lists menu to edit a custom list format.
Other List Behavior
You will notice various improvements related to the behavior of lists when you perform certain actions, including:
-
Unbinding When unbinding lists, items will not result in a <p> tag within another <p> tag.
-
Pasting When pasting one list inside another, the new list will be merged more appropriately.
-
Outdenting When outdenting list items, the result is better.
-
Snippets When you are working with snippets that are part of lists, the behavior is improved (e.g., a block snippet inserted in a list item displays the bullet appropriately in the XML Editor, rather than at the bottom of the content).