Using custom SQL comment types in Database Documentation

This article will explain how add the a custom parameter (such as Author) from your comments to your Database Documentation. This can be useful so the author is named in your documenation. For example, if you have a comment such as:

##AUTHOR_NAME InnovasysTest

There is not an option built in to include this author value, but you can achieve this with a custom template. You can find out how to create a custom template here:

First, you need to navigate to options and then Content Item Types. From there you need to create a new Content item type, with an Id and caption (for example, an ID of "AUTHOR_NAME" and a caption of "AUTHOR_NAME"). Then you need to associate this new Content Item Type with the all the page types under the database documentation in the "Associations" Section. After this, you need to save and restart Document! X for the Custom Content Item type to be saved.

Next, create a new custom template using the above link (ensuring you create one for the Database Documentation). From there, navigate to Page types, and edit connection.html
You need to edit the connection.html page in page types and past in this new DXMetadata element at the top of the BodyContent section:

<!--DXMETADATA start type="TaggedComment" source="Item" id="##AUTHOR_NAME" format="%%replaceinquotes:value=false%%%%scrap:name=_COLLAPSIBLE_HEADER,idprefix=author_name,caption=""Author""%%%%comment%%</div>" --><!--DXMETADATA end -->

This will make the new Author Section appear at the top of the Connections page. This section will include content from your ##AUTHOR_NAME source comments and you can also create content in this new section directly within the Content File Editor.

Note that the caption value is the displayed heading of the dropdown section. You can change the position of the Author section by moving it to another part of the Body Content section if you wish. You also would need to repeat this step for any other page type you wish to include this section in (e.g. in Rule.html).

Here is a movie outlining how you create custom Content Item Types:

You can also repeat this for other comment sections using the same method - just simply change the reference to the ##AUTHOR_NAME Content Item Type.



Have more questions? Submit a request


Please sign in to leave a comment.