Add a custom icon to member lists that you can switch on and off for particular members

It is increasingly common for commercial development tools and components to make available in several different editions. This poses a challenge to the technical writer in highlighting which members are available in different editions of an SDK.

The information in this article outlines how to customize a Document! X Template and create a new content type to allow members to be identified as specific to a particular edition of an SDK (in this example, an Express edition) and have those members indicated by an icon in the members list in the generated documentation and Content Editors. This process can also be adapted for tracking and highlighting other attributes of members (e.g. deprecated, platform).

Modifying the Template

Note: If you have not done so already, create a custom Template for your modifications. Consult the Document! X online help for information on creating custom Templates.

To modify your template:

  1. In the Template editor, select the Other Files page menu item;
  2. Right-click the packages folder and select Open in Windows Explorer context menu option. From there, you need to create a new folder named "Custom" and then a new folder in that directory named "dotnetimages";
  3. Copy the icon image you want to use into the new dotnetimages sub-folder (e.g. express.gif);
  4. In the Template Editor, right-click on the newly created dotnetimages folder and select the Add Existing Other File context menu option - from there, navigate into the "templates/packages/Custom/dotnetimages" directory and select the express.gif file you added to that folder in the previous step;
  5. In the Template Editor, switch to the Scraps page and edit the Scrap named "_MEMBER_LIST_BODY" by inserting the following HTML at the end of the existing image cell (e.g. just before the closing </TD>):
%%TaggedComment:source=Item, id=##EXPRESS, Format="<IMG alt='Available in 
Express Edition' align=left 
SRC=/templates/packages/custom/dotnetimages/express.gif>"%%
  1. Click OK to save your changes to the template.
By default, custom templates are saved to the \programdata\innovasys\documentx2019\templates\<documentationtype> folder (\documents and settings\all users\innovasys\documentx2019\templates\<documentationtype> on Windows XP).

Defining the new Content Type

  1. Select the Content Item Types page in the Document! X configuration editor
  2. Click the New toolbar button
  3. Type "Express" in the Identifier and Caption fields
  4. Type "General Description" in the Group field
  5. Select the desired Icon that will be used to identify this new content type in the Document! X content editors
  6. Type "express" in the XML tag name field. This will allow you to use an XML comment to identify members as "express edition" in the source code (e.g. /// <express/>)
  7. Tick Method, Property, Field and Event from the Can be associated with list
  8. Click OK to save the new content type

Marking members as applicable to the Express Edition

Re-open any currently open project to ensure your latest template changes are used and ensure your Template has been selected on the Templates page in the Build Profile Editor.

You can now use the Content File editor to mark members as being applicable to the Express edition as follows:

  1. Select the member you want to mark as express
  2. Click on the icon in the Content File Editor toolbar for the Express content type
  3. Type some text (any text will do - e.g. "Yes")

When you now build your documentation an additional icon will be included in the member list for members you have marked with the Express content type. 

You could also choose to include a TaggedComment page element with some static text in the member page layouts to highlight the Express edition membership. Example:

<!--DXMETADATA start type="TaggedComment" source="Item" id="##EXPRESS" format="<p>This member is only available in the Express Edition</p>" --><!--DXMETADATA end -->

 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.