Conditional Content

Depending on the layout chosen and the template files format, pure information delivered by ctcreport often needs some encapsulating content, like HTML elements containing the information. For structured templates, this is achieved by conditionally defining variables inside the template.

These definitions are embedded in HTML comments with the general structure:

<!-- CTC_DEFINE("_Variable" 
                "Condition" 
                "Content if Condition is TRUE" 
                "Content if Condition is FALSE")
-->

These variable names must start with an underscore.

The following conditions are available:

Level2Available
True if a layout with two levels of information is chosen for current page (overview / detail).
SourceDrillable
Independently for level 1 and level 2, this condition is true if:
  • the source code view is generated by layout choice and
  • the entity on the level is file or function.
With this condition, a link to source code pages can be generated that is only present in output when available and meaningful.
DetailDrillable

This condition is true on the overview page for the entity for which detail pages are generated.

JustificationsIncluded
True if the report is generated with option -include-justifications.
OverviewLevel1Linked
This condition is used on detail pages. It is true if the detail pages are generated for level 1 from overview page. It is used to structure the sibling navigation conditionally.

Example: One or two entities in table caption

In table headers in overview and detail pages, the one or two reported entities are mentioned using this definition of $_Entities$:

<!-- CTC_DEFINE("_Entities"
                "Level2Available"
                "$Level1Entities$ and $Level2Entities$"
                "$Level1Entities$")
-->