Customizing the Code view toolbar

The Code view toolbar displays 15 buttons initially. This is a subset of the buttons that are available. You can customize the Code view toolbar by changing the buttons that appear on the toolbar and the order in which they appear by editing the file Configuration/Toolbars/Toolbars.xml. You can also insert your own buttons into the toolbar through the Extension Manager.

To change the order of button:

  1. Open the file Configuration/Toolbars/toolbars.xml.
  2. Locate the Code view toolbar section by searching for the following comment:
    <!-- Code view toolbar -->
  3. Copy and paste the button tags so that they appear in the order you want on the toolbar.
  4. Save the file.

To remove a button:

  1. Open the file Configuration/Toolbars/toolbars.xml.
  2. Locate the Code view toolbar section by searching for the following comment:
    <!-- Code view toolbar -->
  3. Surround the button you want to remove with a comment.

    The following example shows a button that is surrounded by comments so that it does not appear on the toolbar:

    <!-- remove button from Code view toolbar <button id="DW_ExpandAll" image="Toolbars/images/MM/T_ExpandAll_Sm_N.png" disabledImage="Toolbars/images/MM/T_ExpandAll_Sm_D.png" tooltip="Expand All" domRequired="false"  enabled="dw.getFocus(true) == 'textView' || dw.getFocus(true) == ¬ 'html'"  command="if (dw.getFocus(true) == 'textView' || dw.getFocus(true) ¬ == 'html') dw.getDocumentDOM().source.expandAllCodeFragments();" update="onViewChange" />-->
  4. Save the file.

To make any buttons that are not visible in the toolbar appear, you remove the comment that surrounds a button in the XML file.